]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/88069 (ICE in check_loop_closed_ssa_def, at tree-ssa-loop...
authorRichard Biener <rguenther@suse.de>
Tue, 20 Nov 2018 10:27:57 +0000 (10:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 20 Nov 2018 10:27:57 +0000 (10:27 +0000)
2018-11-20  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88069
* tree-ssa-sccvn.c (visit_phi): Do not value-number to unvisited
virtual PHI arguments.

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

From-SVN: r266308

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr88069.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c

index 75893260d525130a2b2967eb9ec21df67fe98604..9cf7bb1be2e06f83c11d9f00edd358ea96761e10 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88069
+       * tree-ssa-sccvn.c (visit_phi): Do not value-number to unvisited
+       virtual PHI arguments.
+
 2018-11-20  Ilya Leoshkevich  <iii@linux.ibm.com>
 
        PR target/88083
index 17cb43892a351aadbcad86fe1d340e5c56ecb017..099d464d10e36443d6825297c2403750eb4f2909 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-20  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88069
+       * gcc.dg/pr88069.c: New testcase.
+
 2018-11-20  Martin Liska  <mliska@suse.cz>
 
        PR ipa/88093
diff --git a/gcc/testsuite/gcc.dg/pr88069.c b/gcc/testsuite/gcc.dg/pr88069.c
new file mode 100644 (file)
index 0000000..2148513
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-pre -ftree-vectorize -fno-tree-pta" } */
+
+void
+qf (void);
+
+void
+mr (short int db)
+{
+  int vq;
+  short int *lp = &db;
+
+  for (vq = 0; vq < 1; ++vq)
+    qf ();
+
+  while (*lp < 2)
+    {
+      *lp = db;
+      lp = (short int *) &vq;
+      ++*lp;
+    }
+}
+
index 01bedf56662aec710225298886b62ce7d2edb223..941752e7887a0be27b7bd956d7939b4264a422be 100644 (file)
@@ -4194,12 +4194,19 @@ visit_phi (gimple *phi, bool *inserted, bool backedges_varying_p)
      value from the backedge as that confuses the alias-walking code.
      See gcc.dg/torture/pr87176.c.  If the value is the same on a
      non-backedge everything is OK though.  */
-  if (backedge_val
-      && !seen_non_backedge
-      && TREE_CODE (backedge_val) == SSA_NAME
-      && sameval == backedge_val
-      && (SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val)
-         || SSA_VAL (backedge_val) != backedge_val))
+  bool visited_p;
+  if ((backedge_val
+       && !seen_non_backedge
+       && TREE_CODE (backedge_val) == SSA_NAME
+       && sameval == backedge_val
+       && (SSA_NAME_IS_VIRTUAL_OPERAND (backedge_val)
+          || SSA_VAL (backedge_val) != backedge_val))
+      /* Do not value-number a virtual operand to sth not visited though
+        given that allows us to escape a region in alias walking.  */
+      || (sameval
+         && TREE_CODE (sameval) == SSA_NAME
+         && SSA_NAME_IS_VIRTUAL_OPERAND (sameval)
+         && (SSA_VAL (sameval, &visited_p), !visited_p)))
     /* Note this just drops to VARYING without inserting the PHI into
        the hashes.  */
     result = PHI_RESULT (phi);
This page took 0.131156 seconds and 5 git commands to generate.