]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/82402 (error: SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set)
authorRichard Biener <rguenther@suse.de>
Fri, 24 Nov 2017 12:34:23 +0000 (12:34 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 24 Nov 2017 12:34:23 +0000 (12:34 +0000)
2017-11-24  Richard Biener  <rguenther@suse.de>

PR tree-optimization/82402
* tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly
set SSA_NAME_OCCURS_IN_ABNORMAL_PHI.

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

From-SVN: r255140

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr82402.c [new file with mode: 0644]
gcc/tree-vect-loop-manip.c

index b866e2512a15944dff58ef57bc44c1ab44fc5144..acced0c72fe5d21e538da60492005f4563054285 100644 (file)
@@ -1,3 +1,9 @@
+2017-11-24  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/82402
+       * tree-vect-loop-manip.c (create_lcssa_for_virtual_phi): Properly
+       set SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
+
 2017-11-24  Marc Glisse  <marc.glisse@inria.fr>
 
        * match.pd (0-ptr): New transformation.
index 019ff2afc2bca36c6c4bbe7233653112dadfa089..c43842b45f9b219374b911285ab6295f65058463 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-24  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/82402
+       * gcc.dg/torture/pr82402.c: New testcase.
+
 2017-11-24  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/83128
diff --git a/gcc/testsuite/gcc.dg/torture/pr82402.c b/gcc/testsuite/gcc.dg/torture/pr82402.c
new file mode 100644 (file)
index 0000000..cf90d5c
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+typedef int jmp_buf[1];
+
+extern void exit(int) __attribute__((__noreturn__));
+extern int setjmpx(jmp_buf) __attribute__((__returns_twice__));
+
+jmp_buf jbAnagram;
+int a[6];
+int d;
+int b () { exit (1); }
+int c () { b (); }
+int e ()
+{
+  int f = 0;
+  for (; f < 6; f++)
+    a[f] = d;
+  c ();
+  setjmpx (jbAnagram);
+}
index 1df591e69f21674bd410aa7295476dd4b778d27a..a0d9baf0ee52675c48ec79d66191d973dd6d7b9f 100644 (file)
@@ -639,6 +639,8 @@ create_lcssa_for_virtual_phi (struct loop *loop)
            gimple *stmt;
            use_operand_p use_p;
 
+           SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_vop)
+             = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (vop);
            add_phi_arg (new_phi, vop, exit_e, UNKNOWN_LOCATION);
            gimple_phi_set_result (new_phi, new_vop);
            FOR_EACH_IMM_USE_STMT (stmt, imm_iter, vop)