]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/41261 (ice with -O2 -fprofile-arcs when compiling Linux kernel)
authorRichard Guenther <rguenther@suse.de>
Sun, 6 Sep 2009 16:48:41 +0000 (16:48 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 6 Sep 2009 16:48:41 +0000 (16:48 +0000)
2009-09-06  Richard Guenther  <rguenther@suse.de>

PR middle-end/41261
* tree-ssa-alias.c (refs_may_alias_p_1): Bail out for function decls.

* gcc.dg/torture/pr41261.c: New testcase.

From-SVN: r151460

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr41261.c [new file with mode: 0644]
gcc/tree-ssa-alias.c

index 6edcba28b1c657db5ef12a2a1adc7b619625c7ac..80be0453ef36a563d11986443577546537da9447 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-06  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/41261
+       * tree-ssa-alias.c (refs_may_alias_p_1): Bail out for function decls.
+
 2009-09-05  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/41181
index 7258ffaac56ff6282ca6b5e52d89ee84e801029f..4712bc5e9b50ef18f6e615870023b2ae73d32db5 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-06  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/41261
+       * gcc.dg/torture/pr41261.c: New testcase.
+
 2009-09-05  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/41181
diff --git a/gcc/testsuite/gcc.dg/torture/pr41261.c b/gcc/testsuite/gcc.dg/torture/pr41261.c
new file mode 100644 (file)
index 0000000..8e60155
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-fprofile-arcs" } */
+
+extern void relocate_kernel();
+void machine_kexec(void *control_page)
+{ 
+  __builtin_memcpy(control_page, relocate_kernel, 2048);
+}
index 7e83a84b82ce063dac09d617b5aa1c082bd8c269..89804a923b19acdbd3afc9d08bb35bbaaa6e68b3 100644 (file)
@@ -784,6 +784,12 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
       || is_gimple_min_invariant (base2))
     return false;
 
+  /* We can end up refering to code via function decls.  As we likely
+     do not properly track code aliases conservatively bail out.  */
+  if (TREE_CODE (base1) == FUNCTION_DECL
+      || TREE_CODE (base2) == FUNCTION_DECL)
+    return true;
+
   /* Defer to simple offset based disambiguation if we have
      references based on two decls.  Do this before defering to
      TBAA to handle must-alias cases in conformance with the