aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-10-08 09:54:45 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-10-08 09:54:45 -0700
commit1f1b0541159f25e7d98b1b6b524983aa5de0c329 (patch)
tree56aa58fac2a26580dde976153e0dfb09caa2cf52 /gcc
parent6ba3b2142afa6dc34bc4946e3d147d768a5523b7 (diff)
downloadgcc-1f1b0541159f25e7d98b1b6b524983aa5de0c329.zip
gcc-1f1b0541159f25e7d98b1b6b524983aa5de0c329.tar.gz
gcc-1f1b0541159f25e7d98b1b6b524983aa5de0c329.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expr.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 182fd9c..f9f0298 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2001-10-08 Richard Henderson <rth@redhat.com>
+ * 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 <rth@redhat.com>
+
* varasm.c (restore_varasm_status): New.
* function.h: Declare it.
* function.c (pop_function_context_from): Call it.
diff --git a/gcc/expr.c b/gcc/expr.c
index 52f9cc0..130b3e1 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));