diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-17 14:52:57 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-17 14:52:57 +0000 |
commit | 1211c450433cac7bdd20b9b4e29ff0db5dca0eb7 (patch) | |
tree | df207b909c37336f1bf48d3e70711b0078456b11 /gcc/expr.c | |
parent | 0a80cbc68172a9f8664394d6def4c37ac287fd89 (diff) | |
download | gcc-1211c450433cac7bdd20b9b4e29ff0db5dca0eb7.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183249 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index c5162692241..fb93346eb99 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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; |