This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ptx preliminary address space fixes [2/4]


This is a bug in SRA which replaces a memory reference without taking care to use the correct address space.

Bootstrapped and tested together with the other patches on x86_64-linux. Ok?


Bernd
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.

diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 8259dba..c69cc90 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]