expr.c (expand_expr, [...]): Copy memory attributes when making new MEM.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Thu, 14 Sep 2000 16:53:07 +0000 (16:53 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 14 Sep 2000 16:53:07 +0000 (12:53 -0400)
* expr.c (expand_expr, case COMPONENT_EXPR): Copy memory attributes
when making new MEM.

From-SVN: r36412

gcc/ChangeLog
gcc/expr.c

index ba923270b5d9658df6861034e60a9acd681bc9fd..65a39a26221e29cb375d06086dac34e243fc055d 100644 (file)
@@ -1,5 +1,8 @@
 Thu Sep 14 12:10:16 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * expr.c (expand_expr, case COMPONENT_EXPR): Copy memory attributes
+       when making new MEM.
+
        * Makefile.in (LN): Remove duplicate definition.
 
 2000-09-12  Bernd Schmidt  <bernds@redhat.co.uk>
index baa4ef134b797a325d3a1fe17e95373a387b54aa..66e972fc147e8f79b558944a0fa3ee59e4d560b9 100644 (file)
@@ -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),