commit 6b9be6e3081c313c024aeabe2d70bc0f8146b429
Author: Bernd Schmidt <bernds@codesourcery.com>
Date: Wed Sep 10 16:32:56 2014 +0200
* tree-sra.c (build_ref_for_offset): Use existing address space
when replacing a memory reference.
@@ -1561,6 +1561,7 @@ build_ref_for_offset (location_t loc, tree base, HOST_WIDE_INT offset,
if (align < TYPE_ALIGN (exp_type))
exp_type = build_aligned_type (exp_type, align);
+ exp_type = apply_as_to_type (exp_type, TYPE_ADDR_SPACE (TREE_TYPE (prev_base)));
mem_ref = fold_build2_loc (loc, MEM_REF, exp_type, base, off);
if (TREE_THIS_VOLATILE (prev_base))
TREE_THIS_VOLATILE (mem_ref) = 1;