re PR tree-optimization/79690 (IVOPTs drops gs: prefix)
authorRichard Biener <rguenther@suse.de>
Mon, 27 Feb 2017 08:50:09 +0000 (08:50 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 27 Feb 2017 08:50:09 +0000 (08:50 +0000)
2017-02-27  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.

From-SVN: r245751

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr79690.c [new file with mode: 0644]
gcc/tree-vect-stmts.c

index 1dc82c185e76174c7b759f729753c4753a9edd5c..faf3d66f02931efa19320132688073b2e7d837af 100644 (file)
@@ -1,3 +1,9 @@
+2017-02-27  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.
+
 2017-02-26  Gerald Pfeifer  <gerald@pfeifer.com>
 
        * doc/invoke.texi (Optimize Options): Refine the description
index 30198a6bfe3f7ba934022929a080164ad0fadd2b..3cd68eace95d121f1c0e7649ba099986224f6d2e 100644 (file)
@@ -1,3 +1,8 @@
+2017-02-27  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/79690
+       * gcc.target/i386/pr79690.c: New testcase.
+
 2017-02-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/51119
diff --git a/gcc/testsuite/gcc.target/i386/pr79690.c b/gcc/testsuite/gcc.target/i386/pr79690.c
new file mode 100644 (file)
index 0000000..7bd9317
--- /dev/null
@@ -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:" } } */
index 59768824c0fa87e8eaa17e882f87c95e9dca4223..f4b777eeae61b1c8120177674050649b9edbe023 100644 (file)
@@ -6324,7 +6324,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
                   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