lto/108445 - avoid LTO decl wrapping being confused by tree sharing
r13-4743 exposed more tree sharing which runs into a latent issue with LTO decl wrapping during streaming. The following adds a testcase triggering the issue. PR lto/108445 * gcc.dg/lto/pr108445_0.c: New testcase. * gcc.dg/lto/pr108445_1.c: Likewise.
This commit is contained in:
parent
ddbe758b17
commit
d4abe5c456
2 changed files with 23 additions and 0 deletions
4
gcc/testsuite/gcc.dg/lto/pr108445_0.c
Normal file
4
gcc/testsuite/gcc.dg/lto/pr108445_0.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
/* { dg-lto-do link } */
|
||||
/* { dg-lto-options { "-g -O2 -flto" } } */
|
||||
|
||||
int gArray[16];
|
19
gcc/testsuite/gcc.dg/lto/pr108445_1.c
Normal file
19
gcc/testsuite/gcc.dg/lto/pr108445_1.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
extern int gArray[];
|
||||
|
||||
int foo(int *a)
|
||||
{
|
||||
int *p = a;
|
||||
|
||||
return *p;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc & 1)
|
||||
gArray[argc - 1] = 1;
|
||||
|
||||
if (argc > 1)
|
||||
return foo(gArray);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue