From 1f1b0541159f25e7d98b1b6b524983aa5de0c329 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 8 Oct 2001 09:54:45 -0700 Subject: [PATCH] expr.c (store_expr): When converting a CONST_INT for storage in a SUBREG... * expr.c (store_expr): When converting a CONST_INT for storage in a SUBREG, convert it to both SUBREG modes before stripping the SUBREG. From-SVN: r46081 --- gcc/ChangeLog | 6 ++++++ gcc/expr.c | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 182fd9c931d..f9f029800fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-10-08 Richard Henderson + + * expr.c (store_expr): When converting a CONST_INT for storage + in a SUBREG, convert it to both SUBREG modes before stripping + the SUBREG. + 2001-10-08 Richard Henderson * varasm.c (restore_varasm_status): New. diff --git a/gcc/expr.c b/gcc/expr.c index 52f9cc0f2e0..130b3e1195d 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4152,9 +4152,13 @@ store_expr (exp, target, want_value) /* If TEMP is a VOIDmode constant, use convert_modes to make sure that we properly convert it. */ if (CONSTANT_P (temp) && GET_MODE (temp) == VOIDmode) - temp = convert_modes (GET_MODE (SUBREG_REG (target)), - TYPE_MODE (TREE_TYPE (exp)), temp, - SUBREG_PROMOTED_UNSIGNED_P (target)); + { + temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)), + temp, SUBREG_PROMOTED_UNSIGNED_P (target)); + temp = convert_modes (GET_MODE (SUBREG_REG (target)), + GET_MODE (target), temp, + SUBREG_PROMOTED_UNSIGNED_P (target)); + } convert_move (SUBREG_REG (target), temp, SUBREG_PROMOTED_UNSIGNED_P (target)); -- 2.30.2