[PATCH] Fix PR63844

Richard Biener rguenther@suse.de
Wed Nov 19 09:27:00 GMT 2014


The following improves code-generation for PR63844 by using
a restrict qualified reference type for the OMP receiver decl.
This improves alias analysis and points-to analysis enough to
usually allow invariant and store motion where that was possible
in the non-split-out variant.

Bootstrapped and tested on x86_64-unknown-linux-gnu, ok for trunk?

Sadly I don't have a good testcase (for example one that wasn't
vectorized before but is now).  We can add one later - ISTR there
were a few other bugs about not vectorizing with -fopenmp, I'll
try to find them again and see whether they are fixed.

Thanks,
Richard. 

2014-11-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/63844
	* omp-low.c (fixup_child_record_type): Use a restrict qualified
	referece type for the receiver parameter.

Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c	(revision 217692)
+++ gcc/omp-low.c	(working copy)
@@ -1517,7 +1517,8 @@ fixup_child_record_type (omp_context *ct
       layout_type (type);
     }
 
-  TREE_TYPE (ctx->receiver_decl) = build_pointer_type (type);
+  TREE_TYPE (ctx->receiver_decl)
+    = build_qualified_type (build_reference_type (type), TYPE_QUAL_RESTRICT);
 }
 
 /* Instantiate decls as necessary in CTX to satisfy the data sharing



More information about the Gcc-patches mailing list