diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-15 18:39:02 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-15 18:39:02 +0000 |
commit | d58b6b225fbe01f59e1b76d9dd311707008ec6d3 (patch) | |
tree | cc4e1bde2c0421d91ca1972c84019afb3b941709 /gcc/expmed.c | |
parent | 07c1a295a5f75ef927a4f5c25d46e6e2ec5961db (diff) | |
download | gcc-d58b6b225fbe01f59e1b76d9dd311707008ec6d3.tar.gz |
* expmed.c (expand_shift): If SHIFT_COUNT_TRUNCATED, drop a SUBREG.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17107 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 8170c26b7cc..fba7182e305 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1752,11 +1752,16 @@ expand_shift (code, mode, shifted, amount, target, unsignedp) op1 = expand_expr (amount, NULL_RTX, VOIDmode, 0); #ifdef SHIFT_COUNT_TRUNCATED - if (SHIFT_COUNT_TRUNCATED - && GET_CODE (op1) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (op1) >= GET_MODE_BITSIZE (mode)) - op1 = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (op1) - % GET_MODE_BITSIZE (mode)); + if (SHIFT_COUNT_TRUNCATED) + { + if (GET_CODE (op1) == CONST_INT + && (unsigned HOST_WIDE_INT) INTVAL (op1) >= GET_MODE_BITSIZE (mode)) + op1 = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (op1) + % GET_MODE_BITSIZE (mode)); + else if (GET_CODE (op1) == SUBREG + && SUBREG_WORD (op1) == 0) + op1 = SUBREG_REG (op1); + } #endif if (op1 == const0_rtx) |