aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-04-05 06:57:19 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-04-05 06:57:19 -0400
commitff78f7732cf4bf15d75d11d696ea5563d76ac1fa (patch)
tree98c5cd9f078d1b880d3a855b614267a11e8f264a /gcc
parent597bb7f10b5819fa4209fb5d981f5d660661fb00 (diff)
downloadgcc-ff78f7732cf4bf15d75d11d696ea5563d76ac1fa.zip
gcc-ff78f7732cf4bf15d75d11d696ea5563d76ac1fa.tar.gz
gcc-ff78f7732cf4bf15d75d11d696ea5563d76ac1fa.tar.bz2
(expand_expr, case SAVE_EXPR): Pass promoted type to store_expr.
From-SVN: r4022
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index eadf2e3..4f54ca5 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3491,10 +3491,24 @@ expand_expr (exp, target, tmode, modifier)
}
SAVE_EXPR_RTL (exp) = temp;
- store_expr (TREE_OPERAND (exp, 0), temp, 0);
if (!optimize && GET_CODE (temp) == REG)
save_expr_regs = gen_rtx (EXPR_LIST, VOIDmode, temp,
save_expr_regs);
+
+ /* If the mode of TEMP does not match that of the expression, it
+ must be a promoted value. We pass store_expr a SUBREG of the
+ wanted mode but mark it so that we know that it was already
+ extended. Note that `unsignedp' was modified above in
+ this case. */
+
+ if (GET_CODE (temp) == REG && GET_MODE (temp) != mode)
+ {
+ temp = gen_rtx (SUBREG, mode, SAVE_EXPR_RTL (exp), 0);
+ SUBREG_PROMOTED_VAR_P (temp) = 1;
+ SUBREG_PROMOTED_UNSIGNED_P (temp) = unsignedp;
+ }
+
+ store_expr (TREE_OPERAND (exp, 0), temp, 0);
}
/* If the mode of SAVE_EXPR_RTL does not match that of the expression, it