From c7d97b2846c5647a81548caa3264d77c0a595010 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 28 Feb 2017 09:17:20 +0000 Subject: re PR tree-optimization/79723 (Another case of dropped gs: prefix) 2017-02-28 Richard Biener 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 --- gcc/tree-vect-stmts.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/tree-vect-stmts.c') 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; } -- cgit v1.1