From b3ca30df78d4c4a33cc268f12301b3f8493824c6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 8 Jan 2002 21:10:39 +0100 Subject: expr.c (store_expr): Convert VOIDmode constants back to target's mode. * expr.c (store_expr): Convert VOIDmode constants back to target's mode. * gcc.dg/20020108-1.c: New test. From-SVN: r48658 --- gcc/expr.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'gcc/expr.c') diff --git a/gcc/expr.c b/gcc/expr.c index 04d801d..d11df99 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4041,13 +4041,19 @@ store_expr (exp, target, want_value) target. Otherwise, the caller might get confused by a result whose mode is larger than expected. */ - if (want_value && GET_MODE (temp) != GET_MODE (target) - && GET_MODE (temp) != VOIDmode) + if (want_value && GET_MODE (temp) != GET_MODE (target)) { - temp = gen_lowpart_SUBREG (GET_MODE (target), temp); - SUBREG_PROMOTED_VAR_P (temp) = 1; - SUBREG_PROMOTED_UNSIGNED_P (temp) - = SUBREG_PROMOTED_UNSIGNED_P (target); + if (GET_MODE (temp) != VOIDmode) + { + temp = gen_lowpart_SUBREG (GET_MODE (target), temp); + SUBREG_PROMOTED_VAR_P (temp) = 1; + SUBREG_PROMOTED_UNSIGNED_P (temp) + = SUBREG_PROMOTED_UNSIGNED_P (target); + } + else + temp = convert_modes (GET_MODE (target), + GET_MODE (SUBREG_REG (target)), + temp, SUBREG_PROMOTED_UNSIGNED_P (target)); } return want_value ? temp : NULL_RTX; -- cgit v1.1