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.
--- /dev/null
+/* { dg-lto-do link } */
+/* { dg-lto-options { "-g -O2 -flto" } } */
+
+int gArray[16];
--- /dev/null
+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;
+}