aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-01-08 21:10:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2002-01-08 21:10:39 +0100
commitb3ca30df78d4c4a33cc268f12301b3f8493824c6 (patch)
treebf54c07842103da5e917c623c1710747425f3ef1 /gcc/expr.c
parent66839ef65ef900d409a19b269f60731224f55275 (diff)
downloadgcc-b3ca30df78d4c4a33cc268f12301b3f8493824c6.zip
gcc-b3ca30df78d4c4a33cc268f12301b3f8493824c6.tar.gz
gcc-b3ca30df78d4c4a33cc268f12301b3f8493824c6.tar.bz2
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
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c18
1 files changed, 12 insertions, 6 deletions
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;