diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-14 08:10:55 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-14 08:10:55 +0000 |
commit | 6026d749aa74ba4a3dbf40ddfecdd16cb0fd968d (patch) | |
tree | 846f43789220854350a5292b7c8ad1aa4e0e2c86 /gcc/cse.c | |
parent | f2d989b4c93cd49e08e6e7333eec5e886a58c0f1 (diff) | |
download | gcc-6026d749aa74ba4a3dbf40ddfecdd16cb0fd968d.tar.gz |
PR bootstrap/39454
* cse.c (fold_rtx): Don't modify original const_arg1 when
canonicalizing SHIFT_COUNT_TRUNCATED shift count, do it on a
separate variable instead.
* rtlanal.c (nonzero_bits1) <case ASHIFTRT>: Don't assume anything
from out of range shift counts.
(num_sign_bit_copies1) <case ASHIFTRT, case ASHIFT>: Similarly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r-- | gcc/cse.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cse.c b/gcc/cse.c index bab0908c984..04f52fb7d77 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -3464,6 +3464,7 @@ fold_rtx (rtx x, rtx insn) int is_shift = (code == ASHIFT || code == ASHIFTRT || code == LSHIFTRT); rtx y, inner_const, new_const; + rtx canon_const_arg1 = const_arg1; enum rtx_code associate_code; if (is_shift @@ -3471,8 +3472,9 @@ fold_rtx (rtx x, rtx insn) || INTVAL (const_arg1) < 0)) { if (SHIFT_COUNT_TRUNCATED) - const_arg1 = GEN_INT (INTVAL (const_arg1) - & (GET_MODE_BITSIZE (mode) - 1)); + canon_const_arg1 = GEN_INT (INTVAL (const_arg1) + & (GET_MODE_BITSIZE (mode) + - 1)); else break; } @@ -3531,7 +3533,8 @@ fold_rtx (rtx x, rtx insn) associate_code = (is_shift || code == MINUS ? PLUS : code); new_const = simplify_binary_operation (associate_code, mode, - const_arg1, inner_const); + canon_const_arg1, + inner_const); if (new_const == 0) break; |