[PATCH] Fix PR71185

Richard Biener rguenther@suse.de
Fri May 20 09:08:00 GMT 2016


prefetching was prefetching for register operations like
BIT_FIELD_REF <ssa_name_1, 8, 8>.  That's obviously just stupid.

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

Richard.

2016-05-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71185
	* tree-ssa-loop-prefetch.c (gather_memory_references): Drop
	register operations.

	* gcc.dg/tree-ssa/pr71185.c: New testcase.

Index: gcc/tree-ssa-loop-prefetch.c
===================================================================
*** gcc/tree-ssa-loop-prefetch.c	(revision 236497)
--- gcc/tree-ssa-loop-prefetch.c	(working copy)
*************** gather_memory_references (struct loop *l
*** 631,636 ****
--- 631,639 ----
  	      continue;
  	    }
  
+ 	  if (! gimple_vuse (stmt))
+ 	    continue;
+ 
  	  lhs = gimple_assign_lhs (stmt);
  	  rhs = gimple_assign_rhs1 (stmt);
  
Index: gcc/testsuite/gcc.dg/tree-ssa/pr71185.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/pr71185.c	(revision 0)
--- gcc/testsuite/gcc.dg/tree-ssa/pr71185.c	(working copy)
***************
*** 0 ****
--- 1,13 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O3" } */
+ /* { dg-options "-O3 -march=barcelona" { target x86_64-*-* i?86-*-* } } */
+ 
+ union U { struct S { int l; int m; } p; long long a; } b;
+ int a, c;
+ 
+ void
+ foo ()
+ {
+   for (; b.p.m; b.a += c)
+     a = b.p.l / 65536.0 * 65536.0;
+ }



More information about the Gcc-patches mailing list