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 PR57275


This fixes PR57275 - when moving dependency testing for gather loads
from data-ref analysis to dependence analysis I put in the wrong
return value (oops) for failed analysis.

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

Richard.

2013-05-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/57275
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Fix
	return value for fail to do runtime alias checks for gather loads.

	* gcc.target/i386/pr57275.c: New testcase.

Index: gcc/tree-vect-data-refs.c
===================================================================
*** gcc/tree-vect-data-refs.c	(revision 198890)
--- gcc/tree-vect-data-refs.c	(working copy)
*************** vect_analyze_data_ref_dependence (struct
*** 269,275 ****
  	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
  				 DR_REF (drb));
  	    }
! 	  return false;
  	}
  
        if (dump_enabled_p ())
--- 269,275 ----
  	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
  				 DR_REF (drb));
  	    }
! 	  return true;
  	}
  
        if (dump_enabled_p ())
*************** vect_analyze_data_ref_dependence (struct
*** 305,311 ****
  	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
  				 DR_REF (drb));
  	    }
! 	  return false;
  	}
  
        if (dump_enabled_p ())
--- 305,311 ----
  	      dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
  				 DR_REF (drb));
  	    }
! 	  return true;
  	}
  
        if (dump_enabled_p ())
Index: gcc/testsuite/gcc.target/i386/pr57275.c
===================================================================
*** gcc/testsuite/gcc.target/i386/pr57275.c	(revision 0)
--- gcc/testsuite/gcc.target/i386/pr57275.c	(working copy)
***************
*** 0 ****
--- 1,39 ----
+ /* { dg-do run } */
+ /* { dg-options "-O3 -march=native" } */
+ 
+ extern void abort (void);
+ 
+ #define N 1024
+ 
+ float a[N], b[N], c[N];
+ int k[N];
+ 
+ __attribute__((noinline, noclone)) void
+ f (void)
+ {
+   int i;
+   for (i = 0; i < N; i++)
+     {
+       a[i] = b[k[i]];
+       b[i] = c[i];
+     }
+ }
+ 
+ int main ()
+ {
+   int i;
+ 
+   for (i = 0; i < N; i++)
+   {
+     k[i] = i%2;
+     b[i] = i;
+     c[i] = 179;
+   }
+ 
+   f ();
+ 
+   if (a[2] != 179 || a[3] != 179)
+     abort ();
+ 
+   return 0;
+ }


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