]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2019-01-15 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Jan 2019 15:37:29 +0000 (15:37 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Jan 2019 15:37:29 +0000 (15:37 +0000)
PR tree-optimization/88855
* tree-if-conv.c (combine_blocks): Collect
SSA_NAME_OCCURS_IN_ABNORMAL_PHI from propagated out virtuals.

* gcc.dg/pr88855.c: New testcase.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr88855.c [new file with mode: 0644]
gcc/tree-if-conv.c

index e45150933e093ec65981f21863d44a08bc61cc88..14f0730a0388bd28eb709963371db5952e9ce21e 100644 (file)
@@ -1,3 +1,9 @@
+2019-01-15  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88855
+       * tree-if-conv.c (combine_blocks): Collect
+       SSA_NAME_OCCURS_IN_ABNORMAL_PHI from propagated out virtuals.
+
 2019-01-15  Tom de Vries  <tdevries@suse.de>
 
        PR target/80547
index 999810a1c897ca31c6093d78fada0e3a2c81aa62..a5cfa7f6291f0ae80b00b5834de6ebee2d796b71 100644 (file)
@@ -1,3 +1,8 @@
+2019-01-15  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88855
+       * gcc.dg/pr88855.c: New testcase.
+
 2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * g++.dg/diagnostic/typedef-initialized.C: New.
diff --git a/gcc/testsuite/gcc.dg/pr88855.c b/gcc/testsuite/gcc.dg/pr88855.c
new file mode 100644 (file)
index 0000000..be6ffe3
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-if-convert -ftree-vrp -fno-tree-copy-prop -fno-tree-dce -fno-tree-dominator-opts" } */
+
+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 76a5bc481da2d1b744723d60f60c8d28dcade44e..bdd4c2aa6c42721247664dc93c2beba3fd7d1a3e 100644 (file)
@@ -2633,6 +2633,8 @@ combine_blocks (struct loop *loop)
              FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
                SET_USE (use_p, last_vdef);
            }
+         if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_phi_result (vphi)))
+           SSA_NAME_OCCURS_IN_ABNORMAL_PHI (last_vdef) = 1;
          gsi = gsi_for_stmt (vphi); 
          remove_phi_node (&gsi, true);
        }
@@ -2691,6 +2693,8 @@ combine_blocks (struct loop *loop)
              FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
                SET_USE (use_p, last_vdef);
            }
+         if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_phi_result (vphi)))
+           SSA_NAME_OCCURS_IN_ABNORMAL_PHI (last_vdef) = 1;
          gimple_stmt_iterator gsi = gsi_for_stmt (vphi); 
          remove_phi_node (&gsi, true);
        }