aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-02-28 09:17:20 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-02-28 09:17:20 +0000
commitc7d97b2846c5647a81548caa3264d77c0a595010 (patch)
tree2a955532ce68b68328f58a3dfcbca6d4856dbd07 /gcc/tree-vect-stmts.c
parentd03958cfdfa01c3ad63ac50c190a056f1add4dc0 (diff)
downloadgcc-c7d97b2846c5647a81548caa3264d77c0a595010.zip
gcc-c7d97b2846c5647a81548caa3264d77c0a595010.tar.gz
gcc-c7d97b2846c5647a81548caa3264d77c0a595010.tar.bz2
re PR tree-optimization/79723 (Another case of dropped gs: prefix)
2017-02-28 Richard Biener <rguenther@suse.de> PR tree-optimization/79723 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Preserve address-space properly. * gcc.target/i386/pr79723.c: New testcase. From-SVN: r245772
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index f4b777e..c87f72c 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -8957,6 +8957,7 @@ free_stmt_vec_info (gimple *stmt)
static tree
get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
{
+ tree orig_scalar_type = scalar_type;
machine_mode inner_mode = TYPE_MODE (scalar_type);
machine_mode simd_mode;
unsigned int nbytes = GET_MODE_SIZE (inner_mode);
@@ -9017,6 +9018,12 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
&& !INTEGRAL_MODE_P (TYPE_MODE (vectype)))
return NULL_TREE;
+ /* Re-attach the address-space qualifier if we canonicalized the scalar
+ type. */
+ if (TYPE_ADDR_SPACE (orig_scalar_type) != TYPE_ADDR_SPACE (vectype))
+ return build_qualified_type
+ (vectype, KEEP_QUAL_ADDR_SPACE (TYPE_QUALS (orig_scalar_type)));
+
return vectype;
}