2009-09-06 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 6 Sep 2009 16:48:41 +0000 (16:48 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 6 Sep 2009 16:48:41 +0000 (16:48 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151460 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 6edcba2..80be045 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 7258ffa..4712bc5 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 7e83a84..89804a9 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