aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-09-14 16:53:07 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-09-14 12:53:07 -0400
commitfe7a8445101cfadcda67b45eb1ad0322df8976ae (patch)
tree88973cc2cea2c4796c6f378567e0e60c02568913 /gcc/expr.c
parent9985f21020181f2b6193682334b9e15c8583974c (diff)
downloadgcc-fe7a8445101cfadcda67b45eb1ad0322df8976ae.zip
gcc-fe7a8445101cfadcda67b45eb1ad0322df8976ae.tar.gz
gcc-fe7a8445101cfadcda67b45eb1ad0322df8976ae.tar.bz2
expr.c (expand_expr, [...]): Copy memory attributes when making new MEM.
* expr.c (expand_expr, case COMPONENT_EXPR): Copy memory attributes when making new MEM. From-SVN: r36412
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index baa4ef1..66e972f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6939,8 +6939,14 @@ expand_expr (exp, target, tmode, modifier)
/* Get a reference to just this component. */
if (modifier == EXPAND_CONST_ADDRESS
|| modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER)
- op0 = gen_rtx_MEM (mode1, plus_constant (XEXP (op0, 0),
- (bitpos / BITS_PER_UNIT)));
+ {
+ rtx new = gen_rtx_MEM (mode1,
+ plus_constant (XEXP (op0, 0),
+ (bitpos / BITS_PER_UNIT)));
+
+ MEM_COPY_ATTRIBUTES (new, op0);
+ op0 = new;
+ }
else
op0 = change_address (op0, mode1,
plus_constant (XEXP (op0, 0),