re PR tree-optimization/92461 (ICE: verify_ssa failed (error: excess use operand...
authorRichard Biener <rguenther@suse.de>
Tue, 12 Nov 2019 12:08:07 +0000 (12:08 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 12 Nov 2019 12:08:07 +0000 (12:08 +0000)
2019-11-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92461
* tree-vect-loop.c (vect_create_epilog_for_reduction): Update
stmt after propagation.

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

From-SVN: r278093

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

index a56bdc1..ca125cf 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-12  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/92461
+       * tree-vect-loop.c (vect_create_epilog_for_reduction): Update
+       stmt after propagation.
+
 2019-11-12  Martin Liska  <mliska@suse.cz>
 
        * config/i386/i386-options.c (ix86_recompute_optlev_based_flags):
index 8c63ddf..3fa8d21 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-12  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/92461
+       * gcc.dg/torture/pr92461.c: New testcase.
+
 2019-11-12  Martin Liska  <mliska@suse.cz>
 
        * gcc.dg/completion-3.c: Append = to all expected
diff --git a/gcc/testsuite/gcc.dg/torture/pr92461.c b/gcc/testsuite/gcc.dg/torture/pr92461.c
new file mode 100644 (file)
index 0000000..1d05907
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-ftree-vectorize" } */
+
+short int zb;
+
+void
+gs (void)
+{
+  while (zb < 1)
+    {
+      int at;
+
+      zb %= 1;
+
+      for (at = 0; at < 56; ++at)
+       zb += zb;
+
+      ++zb;
+    }
+}
index d0fb6c2..29770db 100644 (file)
@@ -5299,8 +5299,11 @@ vect_create_epilog_for_reduction (stmt_vec_info stmt_info,
           orig_name = PHI_RESULT (exit_phi);
           scalar_result = scalar_results[k];
           FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, orig_name)
-            FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
-              SET_USE (use_p, scalar_result);
+           {
+             FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
+               SET_USE (use_p, scalar_result);
+             update_stmt (use_stmt);
+           }
         }
 
       phis.release ();