summaryrefslogtreecommitdiffstats
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-06 01:28:56 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-06 01:28:56 +0000
commitbb11bacbbd087cfdabf09fca407fcc55e591170c (patch)
treeb7c9a0b5e5732c3e2352370cd06bdd08df1ce5df /gcc/expr.c
parent57b1f6d5ddbd7bfbb4a33f82abdf514d9310dc36 (diff)
downloadppe42-gcc-bb11bacbbd087cfdabf09fca407fcc55e591170c.tar.gz
ppe42-gcc-bb11bacbbd087cfdabf09fca407fcc55e591170c.zip
* expr.c (store_expr): If the lhs is a memory location pointed to be a postincremented (or postdecremented) pointer, always force the rhs to be evaluated into a pseudo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 09a7eb1f16a..496764244ec 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3528,21 +3528,6 @@ store_expr (exp, target, want_value)
return want_value ? target : NULL_RTX;
}
- else if (want_value && GET_CODE (target) == MEM && ! MEM_VOLATILE_P (target)
- && GET_MODE (target) != BLKmode)
- /* If target is in memory and caller wants value in a register instead,
- arrange that. Pass TARGET as target for expand_expr so that,
- if EXP is another assignment, WANT_VALUE will be nonzero for it.
- We know expand_expr will not use the target in that case.
- Don't do this if TARGET is volatile because we are supposed
- to write it and then read it. */
- {
- temp = expand_expr (exp, cse_not_expected ? NULL_RTX : target,
- GET_MODE (target), 0);
- if (GET_MODE (temp) != BLKmode && GET_MODE (temp) != VOIDmode)
- temp = copy_to_reg (temp);
- dont_return_target = 1;
- }
else if (queued_subexp_p (target))
/* If target contains a postincrement, let's not risk
using it as the place to generate the rhs. */
@@ -3562,6 +3547,21 @@ store_expr (exp, target, want_value)
if (! MEM_VOLATILE_P (target) && want_value)
dont_return_target = 1;
}
+ else if (want_value && GET_CODE (target) == MEM && ! MEM_VOLATILE_P (target)
+ && GET_MODE (target) != BLKmode)
+ /* If target is in memory and caller wants value in a register instead,
+ arrange that. Pass TARGET as target for expand_expr so that,
+ if EXP is another assignment, WANT_VALUE will be nonzero for it.
+ We know expand_expr will not use the target in that case.
+ Don't do this if TARGET is volatile because we are supposed
+ to write it and then read it. */
+ {
+ temp = expand_expr (exp, cse_not_expected ? NULL_RTX : target,
+ GET_MODE (target), 0);
+ if (GET_MODE (temp) != BLKmode && GET_MODE (temp) != VOIDmode)
+ temp = copy_to_reg (temp);
+ dont_return_target = 1;
+ }
else if (GET_CODE (target) == SUBREG && SUBREG_PROMOTED_VAR_P (target))
/* If this is an scalar in a register that is stored in a wider mode
than the declared mode, compute the result into its declared mode
OpenPOWER on IntegriCloud