summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-07 12:43:38 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-07 12:43:38 +0000
commit6e99c565a86a5c1ab7fbdf961320626e069e4905 (patch)
treee95c41a2882b861f19c23029d218aecd8fe899ca /gcc/expr.c
parent14c5d106f5a0396d123d65f6eeb3d969553bcfcc (diff)
downloadgcc-6e99c565a86a5c1ab7fbdf961320626e069e4905.tar.gz
2010-07-07 Richard Guenther <rguenther@suse.de>
PR middle-end/44790 * expr.c (expand_expr_real_1): Go the POINTER_PLUS_EXPR path for expanding the constant offset for MEM_REFs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161907 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index a43d708f273..00ebfdc6429 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8777,13 +8777,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
base = build2 (BIT_AND_EXPR, TREE_TYPE (base),
gimple_assign_rhs1 (def_stmt),
gimple_assign_rhs2 (def_stmt));
- op0 = expand_expr (base, NULL_RTX, address_mode, EXPAND_NORMAL);
if (!integer_zerop (TREE_OPERAND (exp, 1)))
- {
- rtx off;
- off = immed_double_int_const (mem_ref_offset (exp), address_mode);
- op0 = simplify_gen_binary (PLUS, address_mode, op0, off);
- }
+ base = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base),
+ base, double_int_to_tree (sizetype,
+ mem_ref_offset (exp)));
+ op0 = expand_expr (base, NULL_RTX, address_mode, EXPAND_SUM);
op0 = memory_address_addr_space (mode, op0, as);
temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, exp, 0);