re PR tree-optimization/63738 (ssa corruption when compiled with -O3)
authorRichard Biener <rguenther@suse.de>
Wed, 26 Nov 2014 15:16:24 +0000 (15:16 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 26 Nov 2014 15:16:24 +0000 (15:16 +0000)
2014-11-26  Richard Biener  <rguenther@suse.de>

PR middle-end/63738
* tree-data-ref.c (split_constant_offset_1): Do not follow
SSA edges for SSA names with SSA_NAME_OCCURS_IN_ABNORMAL_PHI.

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

From-SVN: r218088

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr63738.c [new file with mode: 0644]
gcc/tree-data-ref.c

index 34f66f95b2b472739adaeb041272fbcf2239f185..79c5411c3247dcce01de4456c699156bf5e2451a 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-26  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/63738
+       * tree-data-ref.c (split_constant_offset_1): Do not follow
+       SSA edges for SSA names with SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
+
 2014-11-26  Richard Biener  <rguenther@suse.de>
 
        * fold-const.h (const_unop): Declare.
index 19e7aa17c6a9d8a3970b23ec27179ac1d5267e4d..5c0ecd7cddb86f8334ada7ce5a31b902766620b7 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-26  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/63738
+       * gcc.dg/torture/pr63738.c: New testcase.
+
 2014-11-26  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        PR bootstrap/63995
diff --git a/gcc/testsuite/gcc.dg/torture/pr63738.c b/gcc/testsuite/gcc.dg/torture/pr63738.c
new file mode 100644 (file)
index 0000000..de40a9c
--- /dev/null
@@ -0,0 +1,27 @@
+/*  { dg-do compile } */
+
+#include <setjmp.h>
+
+struct longjmp_buffer {
+  jmp_buf buf;
+};
+
+void plouf();
+
+extern long interprete()
+{
+  long * sp;
+  int i;
+  long *args;
+  int n;
+
+  struct longjmp_buffer raise_buf;
+  _setjmp (raise_buf.buf);
+
+  plouf();
+  sp -= 4;
+  for (i = 0; i < n; i++)
+    args[i] = sp[10-i];
+  plouf();
+  return 0;
+}
index 909751c8ff3a31f25da419a9afc9126a92fb72a1..387da6cb40ecae584667c94dfb848a3ee1c98d5c 100644 (file)
@@ -674,6 +674,9 @@ split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1,
 
     case SSA_NAME:
       {
+       if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op0))
+         return false;
+
        gimple def_stmt = SSA_NAME_DEF_STMT (op0);
        enum tree_code subcode;