diff options
author | Jim Wilson <wilson@cygnus.com> | 1999-06-22 14:39:07 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1999-06-22 07:39:07 -0700 |
commit | 3dbecef9bc52c4e9437c7bae83199c78ad90ae2c (patch) | |
tree | 6011c8b16e4d56911d95a559544e24c62cdd6a48 | |
parent | 2618f9559828916859242ab2fc2748d5e1ac670c (diff) | |
download | gcc-3dbecef9bc52c4e9437c7bae83199c78ad90ae2c.zip gcc-3dbecef9bc52c4e9437c7bae83199c78ad90ae2c.tar.gz gcc-3dbecef9bc52c4e9437c7bae83199c78ad90ae2c.tar.bz2 |
Fix for abort when PROMOTE_MODES defined but PROMOTE_FUNCTION_{ARG,RETURN} not.
* expr.c (store_expr): When target is a promoted subreg, return a
promoted subreg as a result.
From-SVN: r27705
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/expr.c | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7a26128..b83b411 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +1999-06-22 Jim Wilson <wilson@cygnus.com> + + * expr.c (store_expr): When target is a promoted subreg, return a + promoted subreg as a result. + Tue Jun 22 17:14:58 1999 Michael Meissner <meissner@cygnus.com> * dwarf2out.c (dwarf2out_frame_debug_expr): Reformat to match GNU @@ -3652,6 +3652,20 @@ store_expr (exp, target, want_value) convert_move (SUBREG_REG (target), temp, SUBREG_PROMOTED_UNSIGNED_P (target)); + + /* If we promoted a constant, change the mode back down to match + 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) + { + temp = gen_rtx_SUBREG (GET_MODE (target), temp, 0); + SUBREG_PROMOTED_VAR_P (temp) = 1; + SUBREG_PROMOTED_UNSIGNED_P (temp) + = SUBREG_PROMOTED_UNSIGNED_P (target); + } + return want_value ? temp : NULL_RTX; } else |