public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATH PR66926,PR66951} simple fix for ICE.
@ 2015-07-22 16:24 Yuri Rumyantsev
  2015-07-23 10:52 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Yuri Rumyantsev @ 2015-07-22 16:24 UTC (permalink / raw)
  To: gcc-patches, Richard Biener, Igor Zamyatin

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]

Hi All,

Here is simple fix which fixes PR66926 and PR66951 - fix condition for
renaming virtual operands to determine that statement is outside of
loop.

Bootstrap and regression testing did not show any new failures.

Is it OK for trunk?

gcc/ChangeLog
2015-07-22  Yuri Rumyantsev  <ysrumyan@gmail.com>

PR tree-optimization/66926,66951
* tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Delete
INNER_LOOP and fix up condition for renaming virtual operands.


gcc/testsuite/ChangeLog
* gcc.dg/vect/pr66951.c: New test.

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 1707 bytes --]

Index: testsuite/gcc.dg/vect/pr66951.c
===================================================================
--- testsuite/gcc.dg/vect/pr66951.c	(revision 0)
+++ testsuite/gcc.dg/vect/pr66951.c	(working copy)
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+int a, b[16], c, d;
+
+void
+fn1 ()
+{
+  for (; d; d++)
+    {
+      for (a = 0; a < 2; a++)
+	;
+      c ^= b[d];
+    }
+}
Index: tree-vect-loop-manip.c
===================================================================
--- tree-vect-loop-manip.c	(revision 225988)
+++ tree-vect-loop-manip.c	(working copy)
@@ -1178,7 +1178,6 @@
 			       int bound1, int bound2)
 {
   struct loop *new_loop = NULL, *first_loop, *second_loop;
-  struct loop *inner_loop = NULL;
   edge skip_e;
   tree pre_condition = NULL_TREE;
   basic_block bb_before_second_loop, bb_after_second_loop;
@@ -1199,9 +1198,6 @@
   if (!slpeel_can_duplicate_loop_p (loop, e))
     return NULL;
 
-  if (loop->inner)
-    inner_loop = loop->inner;
-
   /* We might have a queued need to update virtual SSA form.  As we
      delete the update SSA machinery below after doing a regular
      incremental SSA update during loop copying make sure we don't
@@ -1237,9 +1233,8 @@
 	    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)
-	      if (stmt != new_phi && gimple_bb (stmt) != loop->header
-		  /* Do not rename PHI arguments in inner-loop.  */
-		  && (!inner_loop || gimple_bb (stmt) != inner_loop->header))
+	      if (stmt != new_phi
+		  && !flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
 		FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
 		  SET_USE (use_p, new_vop);
 	  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATH PR66926,PR66951} simple fix for ICE.
  2015-07-22 16:24 [PATH PR66926,PR66951} simple fix for ICE Yuri Rumyantsev
@ 2015-07-23 10:52 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-07-23 10:52 UTC (permalink / raw)
  To: Yuri Rumyantsev; +Cc: gcc-patches, Igor Zamyatin

On Wed, Jul 22, 2015 at 6:09 PM, Yuri Rumyantsev <ysrumyan@gmail.com> wrote:
> Hi All,
>
> Here is simple fix which fixes PR66926 and PR66951 - fix condition for
> renaming virtual operands to determine that statement is outside of
> loop.
>
> Bootstrap and regression testing did not show any new failures.
>
> Is it OK for trunk?

Ok.

Richard.

> gcc/ChangeLog
> 2015-07-22  Yuri Rumyantsev  <ysrumyan@gmail.com>
>
> PR tree-optimization/66926,66951
> * tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Delete
> INNER_LOOP and fix up condition for renaming virtual operands.
>
>
> gcc/testsuite/ChangeLog
> * gcc.dg/vect/pr66951.c: New test.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-23 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-22 16:24 [PATH PR66926,PR66951} simple fix for ICE Yuri Rumyantsev
2015-07-23 10:52 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).