aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-01-10 19:23:47 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-01-10 19:23:47 -0500
commite9baa644022b2d7d0f2f547baa5c7a4b477e7429 (patch)
tree532ba5faff169dbd1e83db0933a6d999b20efbb1 /gcc
parent4a86a6d20f7aede7dd102d03b503eb496ff0eb97 (diff)
downloadgcc-e9baa644022b2d7d0f2f547baa5c7a4b477e7429.zip
gcc-e9baa644022b2d7d0f2f547baa5c7a4b477e7429.tar.gz
gcc-e9baa644022b2d7d0f2f547baa5c7a4b477e7429.tar.bz2
(protect_from_queue): If (MEM (QUEUED ...)), modify a new MEM instead
of the one we were passed. From-SVN: r6375
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 97272a3..7361503 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -416,24 +416,29 @@ protect_from_queue (x, modify)
if (code != QUEUED)
{
- /* A special hack for read access to (MEM (QUEUED ...))
- to facilitate use of autoincrement.
- Make a copy of the contents of the memory location
- rather than a copy of the address, but not
- if the value is of mode BLKmode. */
+ /* A special hack for read access to (MEM (QUEUED ...)) to facilitate
+ use of autoincrement. Make a copy of the contents of the memory
+ location rather than a copy of the address, but not if the value is
+ of mode BLKmode. Don't modify X in place since it might be
+ shared. */
if (code == MEM && GET_MODE (x) != BLKmode
&& GET_CODE (XEXP (x, 0)) == QUEUED && !modify)
{
register rtx y = XEXP (x, 0);
- XEXP (x, 0) = QUEUED_VAR (y);
+ register rtx new = gen_rtx (MEM, GET_MODE (x), QUEUED_VAR (y));
+
+ MEM_IN_STRUCT_P (new) = MEM_IN_STRUCT_P (x);
+ RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (x);
+ MEM_VOLATILE_P (new) = MEM_VOLATILE_P (x);
+
if (QUEUED_INSN (y))
{
- register rtx temp = gen_reg_rtx (GET_MODE (x));
- emit_insn_before (gen_move_insn (temp, x),
+ register rtx temp = gen_reg_rtx (GET_MODE (new));
+ emit_insn_before (gen_move_insn (temp, new),
QUEUED_INSN (y));
return temp;
}
- return x;
+ return new;
}
/* Otherwise, recursively protect the subexpressions of all
the kinds of rtx's that can contain a QUEUED. */