]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR lto/54625 (lto/profiledbootstrap broken by r191466: ICE: in cgraph_clone_edge...
authorRichard Guenther <rguenther@suse.de>
Tue, 25 Sep 2012 15:06:17 +0000 (15:06 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 25 Sep 2012 15:06:17 +0000 (15:06 +0000)
2012-09-25  Richard Guenther  <rguenther@suse.de>

PR lto/54625
* lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Do not merge
cgraph nodes for builtins.

* gcc.dg/lto/pr54702_0.c: New testcase.
* gcc.dg/lto/pr54702_1.c: Likewise.
* gcc.dg/lto/pr54625-1_0.c: Likewise.
* gcc.dg/lto/pr54625-1_1.C: Likewise.
* gcc.dg/lto/pr54625-2_0.c: Likewise.
* gcc.dg/lto/pr54625-2_1.C: Likewise.

From-SVN: r191713

gcc/ChangeLog
gcc/lto-symtab.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr54625-1_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr54625-1_1.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr54625-2_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr54625-2_1.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr54702_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr54702_1.c [new file with mode: 0644]

index 61134bdb6b24b69c9a31a1dc47323c631d640502..75ac7aa7c03fe5c8d64bb98b237b142dc338b924 100644 (file)
@@ -1,3 +1,9 @@
+2012-09-25  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/54625
+       * lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Do not merge
+       cgraph nodes for builtins.
+
 2012-09-25  Dehao Chen  <dehao@google.com>
 
        PR middle-end/54645
index ae73ad448fb0d08ca9d30bcfc163a7733822d40b..a8a46575ba522ecae3d0107d3e63534e03652d46 100644 (file)
@@ -629,7 +629,8 @@ lto_symtab_merge_cgraph_nodes_1 (symtab_node prevailing)
 
       if (!symtab_real_symbol_p (e))
        continue;
-      if (symtab_function_p (e))
+      if (symtab_function_p (e)
+         && !DECL_BUILT_IN (e->symbol.decl))
        lto_cgraph_replace_node (cgraph (e), cgraph (prevailing));
       if (symtab_variable_p (e))
        lto_varpool_replace_node (varpool (e), varpool (prevailing));
index 41d75a68b45a6df4fd25f16fea51b269216d8e8d..4d4162c86214614e7a74d3f4e165d97dc95c158f 100644 (file)
@@ -1,3 +1,13 @@
+2012-09-25  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/54625
+       * gcc.dg/lto/pr54702_0.c: New testcase.
+       * gcc.dg/lto/pr54702_1.c: Likewise.
+       * gcc.dg/lto/pr54625-1_0.c: Likewise.
+       * gcc.dg/lto/pr54625-1_1.C: Likewise.
+       * gcc.dg/lto/pr54625-2_0.c: Likewise.
+       * gcc.dg/lto/pr54625-2_1.C: Likewise.
+
 2012-09-25  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/54526
diff --git a/gcc/testsuite/gcc.dg/lto/pr54625-1_0.c b/gcc/testsuite/gcc.dg/lto/pr54625-1_0.c
new file mode 100644 (file)
index 0000000..5ab90dd
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options { -r -nostdlib } } */
+
+float a;
+double sin ();
+speex_resampler_init_frac ()
+{
+  a = sin (0);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/pr54625-1_1.C b/gcc/testsuite/gcc.dg/lto/pr54625-1_1.C
new file mode 100644 (file)
index 0000000..2d0d5bf
--- /dev/null
@@ -0,0 +1,19 @@
+extern "C" double sin (double);
+typedef double UnaryFunType (double);
+class A
+{
+public:
+  int hash ();
+  double lookup (UnaryFunType p1)
+    {
+      int a = hash ();
+      if (p1)
+       return 0;
+    }
+};
+A b;
+void
+math_sin_impl ()
+{
+  b.lookup (sin);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr54625-2_0.c b/gcc/testsuite/gcc.dg/lto/pr54625-2_0.c
new file mode 100644 (file)
index 0000000..6511ba5
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options { -r -nostdlib } } */
+
+float a;
+double sin ();
+update_filter ()
+{
+  a = sin (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr54625-2_1.C b/gcc/testsuite/gcc.dg/lto/pr54625-2_1.C
new file mode 100644 (file)
index 0000000..09c365d
--- /dev/null
@@ -0,0 +1,24 @@
+extern "C" double sin (double);
+typedef double (*UnaryFunType) (double);
+class A
+{
+public:
+  int hash ();
+  void lookup (UnaryFunType p1)
+    {
+      int a = hash ();
+      p1 (0);
+    }
+};
+A b, c;
+void
+math_sin_impl ()
+{
+  b.lookup (sin);
+}
+
+void
+js_math_sqrt ()
+{
+  c.lookup (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr54702_0.c b/gcc/testsuite/gcc.dg/lto/pr54702_0.c
new file mode 100644 (file)
index 0000000..2242f50
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O2 -flto -w } } } */
+/* { dg-extra-ld-options { -r -nostdlib } } */
+
+#include <stdlib.h>
+void* f ()
+{
+  void* p = malloc (1);
+  return p;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr54702_1.c b/gcc/testsuite/gcc.dg/lto/pr54702_1.c
new file mode 100644 (file)
index 0000000..2afb0fb
--- /dev/null
@@ -0,0 +1,16 @@
+int *b;
+void *d;
+int c;
+static int *f1 ();
+void f2 ()
+{
+  int *a = f1 (0);
+}
+
+int *f1 (j)
+{
+  b = malloc (0);
+  d = *malloc;
+  c = j;
+}
+