]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR bootstrap/40753 (ICE in refs_may_alias_p_1 for libffi/src/powerpc/ffi.c)
authorRichard Guenther <rguenther@suse.de>
Wed, 15 Jul 2009 09:25:34 +0000 (09:25 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 15 Jul 2009 09:25:34 +0000 (09:25 +0000)
2009-07-15  Richard Guenther  <rguenther@suse.de>

PR middle-end/40753
* alias.c (ao_ref_from_mem): Reject FUNCTION_DECL and LABEL_DECL
bases.

* gcc.c-torture/compile/pr40753.c: New testcase.

From-SVN: r149664

gcc/ChangeLog
gcc/alias.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr40753.c [new file with mode: 0644]

index d160c8d26d911eca09626ae40acce0c7d057f0f9..47ac043c0d4c918285cfa2158cc4c3a1de59520c 100644 (file)
@@ -1,3 +1,9 @@
+2009-07-15  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/40753
+       * alias.c (ao_ref_from_mem): Reject FUNCTION_DECL and LABEL_DECL
+       bases.
+
 2009-07-15  Maxim Kuvyrkov  <maxim@codesourcery.com>
 
        * config/m68k/linux-unwind.h (m68k_fallback_frame_state): Update to
index e9cc2d85f96e788a413a9933c340dcee7f2c7cdb..fc259b8ef2df72ae7b0fbd4b8051f6490a152f1c 100644 (file)
@@ -279,6 +279,11 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
       && TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME)
     return false;
 
+  /* The tree oracle doesn't like to have these.  */
+  if (TREE_CODE (base) == FUNCTION_DECL
+      || TREE_CODE (base) == LABEL_DECL)
+    return false;
+
   /* If this is a reference based on a partitioned decl replace the
      base with an INDIRECT_REF of the pointer representative we
      created during stack slot partitioning.  */
index 4dc0801291933c95dea36550de0f257d170a3405..e58a25b882280f07f24b3fca0aca52ff79471639 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-15  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/40753
+       * gcc.c-torture/compile/pr40753.c: New testcase.
+
 2009-07-15  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/40743
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40753.c b/gcc/testsuite/gcc.c-torture/compile/pr40753.c
new file mode 100644 (file)
index 0000000..507303d
--- /dev/null
@@ -0,0 +1,20 @@
+typedef struct {
+    unsigned nargs;
+} ffi_cif;
+typedef struct {
+    char tramp[24];
+    ffi_cif *cif;
+} ffi_closure;
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+extern void ffi_closure_LINUX64 (void);
+
+int
+ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif)
+{
+  void **tramp = (void **) &closure->tramp[0];
+
+  memcpy (tramp, (char *) ffi_closure_LINUX64, 16);
+  closure->cif = cif;
+
+  return 0;
+}