[PATCH] Yet another "fix" for PR37742 / PR37955

Richard Guenther rguenther@suse.de
Fri Nov 28 14:08:00 GMT 2008


As I didn't recieve any encouraging comments about the previous fixing
attempts and I do not like them at all myself the following fixes the
regression present in 4.4 which is that we ICE because we now assert
that the vectorized load/store conflicts with the unvectorized load/store.

Thus, fixed by removing that assert again.  The proper fix for the
aliasing problems is way easier on the alias-improvements branch and
I will install a variant there.

Bootstrap and regtest still running on x86_64-unknown-linux-gnu, but I
do not expect problems from it ;)

Richard.

2008-11-28  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/37955
	PR tree-optimization/37742
	* tree-vect-transform.c (vectorizable_store): Remove assert for
	compatible aliases.
	(vectorizable_load): Likewise.

	* gcc.c-torture/compile/pr37955.c: New testcase.
	* gcc.c-torture/compile/pr37742-3.c: Likewise.

Index: gcc/tree-vect-transform.c
===================================================================
*** gcc/tree-vect-transform.c	(revision 142231)
--- gcc/tree-vect-transform.c	(working copy)
*************** vectorizable_store (gimple stmt, gimple_
*** 5440,5450 ****
  	    vec_oprnd = VEC_index (tree, result_chain, i);
  
  	  data_ref = build_fold_indirect_ref (dataref_ptr);
- 	  /* If accesses through a pointer to vectype do not alias the original
- 	     memory reference we have a problem.  This should never happen.  */
- 	  gcc_assert (get_alias_set (data_ref) == get_alias_set (gimple_assign_lhs (stmt))
- 		      || alias_set_subset_of (get_alias_set (data_ref), 
- 					      get_alias_set (gimple_assign_lhs (stmt))));
  
  	  /* Arguments are ready. Create the new vector stmt.  */
  	  new_stmt = gimple_build_assign (data_ref, vec_oprnd);
--- 5440,5445 ----
*************** vectorizable_load (gimple stmt, gimple_s
*** 6668,6678 ****
  	    default:
  	      gcc_unreachable ();
  	    }
- 	  /* If accesses through a pointer to vectype do not alias the original
- 	     memory reference we have a problem.  This should never happen.  */
- 	  gcc_assert (get_alias_set (data_ref) == get_alias_set (gimple_assign_rhs1 (stmt))
- 		      || alias_set_subset_of (get_alias_set (data_ref),
- 					      get_alias_set (gimple_assign_rhs1 (stmt))));
  	  vec_dest = vect_create_destination_var (scalar_dest, vectype);
  	  new_stmt = gimple_build_assign (vec_dest, data_ref);
  	  new_temp = make_ssa_name (vec_dest, new_stmt);
--- 6663,6668 ----
Index: gcc/testsuite/gcc.c-torture/compile/pr37955.c
===================================================================
*** gcc/testsuite/gcc.c-torture/compile/pr37955.c	(revision 0)
--- gcc/testsuite/gcc.c-torture/compile/pr37955.c	(revision 0)
***************
*** 0 ****
--- 1,19 ----
+ typedef struct
+ {
+   enum { NotConnected = 0 } conn_state;
+   unsigned int conn_hndl;
+ } AEP_CONNECTION_ENTRY;
+ 
+ static AEP_CONNECTION_ENTRY aep_app_conn_table[256];
+ 
+ void aep_mod_exp (void)
+ {
+   int count;
+ 
+   for (count = 0; count < 256; count++)
+     {
+       aep_app_conn_table[count].conn_state = NotConnected;
+       aep_app_conn_table[count].conn_hndl = 0;
+     }
+ }
+ 
Index: gcc/testsuite/gcc.c-torture/compile/pr37742-3.c
===================================================================
*** gcc/testsuite/gcc.c-torture/compile/pr37742-3.c	(revision 0)
--- gcc/testsuite/gcc.c-torture/compile/pr37742-3.c	(revision 0)
***************
*** 0 ****
--- 1,17 ----
+ void matmul_i4 (int * __restrict dest_y,
+ 		const int * __restrict abase,
+ 		const int * __restrict bbase_y,
+ 		int count, int xcount, int ycount, int aystride)
+ {               
+   int x, y, n;
+   const int * __restrict abase_n;
+   int bbase_yn;
+   for (y = 0; y < ycount; y++)
+     for (n = 0; n < count; n++) {
+ 	abase_n = abase + n*aystride;
+ 	bbase_yn = bbase_y[n];
+ 	for (x = 0; x < xcount; x++)
+ 	  dest_y[x] += abase_n[x] * bbase_yn; 
+     }
+ }
+ 



More information about the Gcc-patches mailing list