aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-11-16 07:47:58 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-11-16 07:47:58 -0500
commit5a32d03841c8db674ef3f6fb7e223b37c4122e46 (patch)
tree4badac418f1ec5bf4278f92c749a07ea5ea0f5e3
parent38d42ddbcf98ece1597737ad4c07b5206ce4b6e2 (diff)
downloadgcc-5a32d03841c8db674ef3f6fb7e223b37c4122e46.zip
gcc-5a32d03841c8db674ef3f6fb7e223b37c4122e46.tar.gz
gcc-5a32d03841c8db674ef3f6fb7e223b37c4122e46.tar.bz2
(convert_move): Don't put FROM in a register if it is a SUBREG.
(store_expr): If don't want a value and storing into promoted variable, do conversion at tree level; don't copy volatile MEM unless want value, as comment says. From-SVN: r8466
-rw-r--r--gcc/expr.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0e2f3a3..a1ecf25 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1086,12 +1086,6 @@ convert_move (to, from, unsignedp)
if ((code = can_extend_p (to_mode, from_mode, unsignedp))
!= CODE_FOR_nothing)
{
- /* If FROM is a SUBREG, put it into a register. Do this
- so that we always generate the same set of insns for
- better cse'ing; if an intermediate assignment occurred,
- we won't be doing the operation directly on the SUBREG. */
- if (optimize > 0 && GET_CODE (from) == SUBREG)
- from = force_reg (from_mode, from);
emit_unop_insn (code, to, from, equiv_code);
return;
}
@@ -2721,11 +2715,18 @@ store_expr (exp, target, want_value)
and then convert to the wider mode. Our value is the computed
expression. */
{
+ /* If we don't want a value, we can do the conversion inside EXP,
+ which will often result in some optimizations. */
+ if (! want_value)
+ exp = convert (type_for_mode (GET_MODE (SUBREG_REG (target)),
+ SUBREG_PROMOTED_UNSIGNED_P (target)),
+ exp);
+
temp = expand_expr (exp, NULL_RTX, VOIDmode, 0);
/* If TEMP is a volatile MEM and we want a result value, make
the access now so it gets done only once. */
- if (GET_CODE (temp) == MEM && MEM_VOLATILE_P (temp))
+ if (GET_CODE (temp) == MEM && MEM_VOLATILE_P (temp) && want_value)
temp = copy_to_reg (temp);
/* If TEMP is a VOIDmode constant, use convert_modes to make