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 PR69186


Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2016-01-13  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/69186
	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
	Properly guard vect_update_misalignment_for_peel call.

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

Index: gcc/tree-vect-data-refs.c
===================================================================
*** gcc/tree-vect-data-refs.c	(revision 232261)
--- gcc/tree-vect-data-refs.c	(working copy)
*************** vect_enhance_data_refs_alignment (loop_v
*** 1826,1832 ****
               misalignment of DR_i must be set to unknown.  */
  	  FOR_EACH_VEC_ELT (datarefs, i, dr)
  	    if (dr != dr0)
! 	      vect_update_misalignment_for_peel (dr, dr0, npeel);
  
            LOOP_VINFO_UNALIGNED_DR (loop_vinfo) = dr0;
            if (npeel)
--- 1826,1841 ----
               misalignment of DR_i must be set to unknown.  */
  	  FOR_EACH_VEC_ELT (datarefs, i, dr)
  	    if (dr != dr0)
! 	      {
! 		/* Strided accesses perform only component accesses, alignment
! 		   is irrelevant for them.  */
! 		stmt_info = vinfo_for_stmt (DR_STMT (dr));
! 		if (STMT_VINFO_STRIDED_P (stmt_info)
! 		    && !STMT_VINFO_GROUPED_ACCESS (stmt_info))
! 		  continue;
! 
! 		vect_update_misalignment_for_peel (dr, dr0, npeel);
! 	      }
  
            LOOP_VINFO_UNALIGNED_DR (loop_vinfo) = dr0;
            if (npeel)
Index: gcc/testsuite/gcc.dg/torture/pr69186.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr69186.c	(revision 0)
--- gcc/testsuite/gcc.dg/torture/pr69186.c	(working copy)
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-do compile } */
+ 
+ static int a[10][2];
+ int b;
+ 
+ void
+ fn1 ()
+ {
+   b = 0;
+   for (; b < 6; b++)
+     a[b][2] ^= 1;
+ }


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