This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR47890


This fixes PR47890, bootstrapped and tested on x86_64-unknown-linux-gnu, 
applied.

Richard.

2011-03-01  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/47890
	* tree-vect-loop.c (get_initial_def_for_induction): Set
	related stmt properly.

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

Index: gcc/tree-vect-loop.c
===================================================================
*** gcc/tree-vect-loop.c	(revision 170589)
--- gcc/tree-vect-loop.c	(working copy)
*************** get_initial_def_for_induction (gimple iv
*** 2886,2891 ****
--- 2886,2895 ----
        gimple_assign_set_lhs (new_stmt, induc_def);
        si = gsi_start_bb (bb);
        gsi_insert_before (&si, new_stmt, GSI_SAME_STMT);
+       set_vinfo_for_stmt (new_stmt,
+ 			  new_stmt_vec_info (new_stmt, loop_vinfo, NULL));
+       STMT_VINFO_RELATED_STMT (vinfo_for_stmt (new_stmt))
+ 	= STMT_VINFO_RELATED_STMT (vinfo_for_stmt (induction_phi));
      }
  
    return induc_def;
Index: gcc/testsuite/gcc.dg/torture/pr47890.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr47890.c	(revision 0)
--- gcc/testsuite/gcc.dg/torture/pr47890.c	(revision 0)
***************
*** 0 ****
--- 1,9 ----
+ /* { dg-do compile } */
+ 
+ void f(char *s)
+ {
+   signed short i;
+ 
+   for (i = 0; i < 19; i = i + 1)
+     s[i] = i;
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]