diff options
author | Richard Guenther <rguenther@suse.de> | 2012-01-17 14:52:57 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-01-17 14:52:57 +0000 |
commit | e831c1e8a6dc9f439e7269a741b6891f441880c4 (patch) | |
tree | df207b909c37336f1bf48d3e70711b0078456b11 | |
parent | a6d10e80119b8dc77f7e8d791cbd0546a4b0aa22 (diff) | |
download | gcc-e831c1e8a6dc9f439e7269a741b6891f441880c4.zip gcc-e831c1e8a6dc9f439e7269a741b6891f441880c4.tar.gz gcc-e831c1e8a6dc9f439e7269a741b6891f441880c4.tar.bz2 |
re PR middle-end/51782 (-ftree-sra: Missing address-space information leads to wrong)
2012-01-17 Richard Guenther <rguenther@suse.de>
PR middle-end/51782
* expr.c (expand_assignment): Take address-space information
from the address operand of MEM_REF and TARGET_MEM_REF.
(expand_expr_real_1): Likewise.
From-SVN: r183249
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/expr.c | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9ac0e7..055cc2e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-01-17 Richard Guenther <rguenther@suse.de> + + PR middle-end/51782 + * expr.c (expand_assignment): Take address-space information + from the address operand of MEM_REF and TARGET_MEM_REF. + (expand_expr_real_1): Likewise. + 2012-01-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * ira.c (do_reload): Make sure ira_dump_file is re-set if no @@ -4590,7 +4590,7 @@ expand_assignment (tree to, tree from, bool nontemporal) if (TREE_CODE (to) == MEM_REF) { addr_space_t as - = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (to, 1)))); + = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (to, 0)))); tree base = TREE_OPERAND (to, 0); address_mode = targetm.addr_space.address_mode (as); op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_NORMAL); @@ -4608,7 +4608,8 @@ expand_assignment (tree to, tree from, bool nontemporal) } else if (TREE_CODE (to) == TARGET_MEM_REF) { - addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (to)); + addr_space_t as + = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (to, 0)))); struct mem_address addr; get_address_description (to, &addr); @@ -9253,7 +9254,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, case TARGET_MEM_REF: { - addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (exp)); + addr_space_t as + = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0)))); struct mem_address addr; enum insn_code icode; unsigned int align; @@ -9288,7 +9290,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, case MEM_REF: { addr_space_t as - = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 1)))); + = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0)))); enum machine_mode address_mode; tree base = TREE_OPERAND (exp, 0); gimple def_stmt; |