[PATCH] Fix PR79690

Richard Biener rguenther@suse.de
Fri Feb 24 11:59:00 GMT 2017


The following fixes PR79690.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

Richard.

2017-02-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79690
	* tree-vect-stmts.c (vectorizable_store): Use vector type
	built from the DR with address-space.

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

Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c	(revision 245712)
+++ gcc/tree-vect-stmts.c	(working copy)
@@ -6324,7 +6324,7 @@ vectorizable_store (gimple *stmt, gimple
 		   vect_permute_store_chain().  */
 		vec_oprnd = result_chain[i];
 
-	      data_ref = fold_build2 (MEM_REF, TREE_TYPE (vec_oprnd),
+	      data_ref = fold_build2 (MEM_REF, vectype,
 				      dataref_ptr,
 				      dataref_offset
 				      ? dataref_offset
Index: gcc/testsuite/gcc.target/i386/pr79690.c
===================================================================
--- gcc/testsuite/gcc.target/i386/pr79690.c	(nonexistent)
+++ gcc/testsuite/gcc.target/i386/pr79690.c	(working copy)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse2 -mno-avx" } */
+
+void fill(unsigned char __seg_gs *arr, unsigned char c, long n)
+{
+  for (long i = 0; i < n; ++i)
+    arr[i] = c;
+}
+
+/* { dg-final { scan-assembler "mov\[au\]p.\[ \t\]\[^,\]+, %gs:" } } */



More information about the Gcc-patches mailing list