summaryrefslogtreecommitdiffstats
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-17 17:02:35 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-17 17:02:35 +0000
commitf9636a669db9c65d4f2c187b6f5ab45e13018710 (patch)
tree2b57672c9cea6ba95fc5715c3da4aa5e6c5f0e5b /gcc/expr.c
parent17bad8a87f1f940b8728640902cb922571233d0e (diff)
downloadppe42-gcc-f9636a669db9c65d4f2c187b6f5ab45e13018710.tar.gz
ppe42-gcc-f9636a669db9c65d4f2c187b6f5ab45e13018710.zip
Fix queueing related bugs
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42206 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0f75b6912f9..beafdfdec0f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -396,6 +396,9 @@ protect_from_queue (x, modify)
QUEUED_INSN (y));
return temp;
}
+ /* Copy the address into a pseudo, so that the returned value
+ remains correct across calls to emit_queue. */
+ XEXP (new, 0) = copy_to_reg (XEXP (new, 0));
return new;
}
/* Otherwise, recursively protect the subexpressions of all
@@ -422,9 +425,11 @@ protect_from_queue (x, modify)
}
return x;
}
- /* If the increment has not happened, use the variable itself. */
+ /* If the increment has not happened, use the variable itself. Copy it
+ into a new pseudo so that the value remains correct across calls to
+ emit_queue. */
if (QUEUED_INSN (x) == 0)
- return QUEUED_VAR (x);
+ return copy_to_reg (QUEUED_VAR (x));
/* If the increment has happened and a pre-increment copy exists,
use that copy. */
if (QUEUED_COPY (x) != 0)
@@ -8588,7 +8593,9 @@ expand_expr (exp, target, tmode, modifier)
if (ignore)
return op0;
- op0 = protect_from_queue (op0, 0);
+ /* Pass 1 for MODIFY, so that protect_from_queue doesn't get
+ clever and returns a REG when given a MEM. */
+ op0 = protect_from_queue (op0, 1);
/* We would like the object in memory. If it is a constant, we can
have it be statically allocated into memory. For a non-constant,
OpenPOWER on IntegriCloud