re PR tree-optimization/88243 (ice in vect_create_epilog_for_reduction, at tree-vect...
authorRichard Biener <rguenther@suse.de>
Thu, 29 Nov 2018 13:33:59 +0000 (13:33 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 29 Nov 2018 13:33:59 +0000 (13:33 +0000)
2018-11-29  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88243
* tree-vect-patterns.c (vect_mark_pattern_stmts): Set the def
type of all pattern-sequence stmts to vect_internal_def.

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

From-SVN: r266615

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

index 91a1703db057af182abddc8cad79d82bdbc68d7d..b35b26f6561c832ae042b406eebd438c2884c11c 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-29  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88243
+       * tree-vect-patterns.c (vect_mark_pattern_stmts): Set the def
+       type of all pattern-sequence stmts to vect_internal_def.
+
 2018-11-29  Andre Vieira  <andre.simoesdiasvieira@arm.com>
 
        PR target/88224
index 1764265073df02ff7638fc9eb3d03823f8dc1c22..18a921ceaefe24222af58acbe91431e8bbb8e1e8 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-29  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/88243
+       * gcc.dg/torture/pr88243.c: New testcase.
+
 2018-11-29  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/87539
diff --git a/gcc/testsuite/gcc.dg/torture/pr88243.c b/gcc/testsuite/gcc.dg/torture/pr88243.c
new file mode 100644 (file)
index 0000000..17ca38f
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+int a, b, c;
+
+void d()
+{
+  int e, f;
+  for (; a; a++)
+    {
+      e = (__UINTPTR_TYPE__)d;
+      b = 0;
+      for (; b < 2; b++)
+       {
+         f = e = e / 2;
+         c = c + f;
+       }
+    }
+}
index 2b56d85afc5962df3939befb40f7d81bc121ef7b..39b6f822d198cdaaf587960083c6baf7677bf284 100644 (file)
@@ -4723,7 +4723,15 @@ vect_mark_pattern_stmts (stmt_vec_info orig_stmt_info, gimple *pattern_stmt,
   if (def_seq)
     for (gimple_stmt_iterator si = gsi_start (def_seq);
         !gsi_end_p (si); gsi_next (&si))
-      vect_init_pattern_stmt (gsi_stmt (si), orig_stmt_info, pattern_vectype);
+      {
+       stmt_vec_info pattern_stmt_info
+         = vect_init_pattern_stmt (gsi_stmt (si),
+                                   orig_stmt_info, pattern_vectype);
+       /* Stmts in the def sequence are not vectorizable cycle or
+          induction defs, instead they should all be vect_internal_def
+          feeding the main pattern stmt which retains this def type.  */
+       STMT_VINFO_DEF_TYPE (pattern_stmt_info) = vect_internal_def;
+      }
 
   if (orig_pattern_stmt)
     {