diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-05-12 14:20:43 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-05-12 14:20:43 -0400 |
commit | f6789c7753fa2305592d2f0db5c14d23dc78700b (patch) | |
tree | 6d27a2ddabe0dad9513787395b1dc2bbf65409c9 /gcc | |
parent | efc526c19d35d4521fb58cddbce57cd735d3ddc8 (diff) | |
download | gcc-f6789c7753fa2305592d2f0db5c14d23dc78700b.zip gcc-f6789c7753fa2305592d2f0db5c14d23dc78700b.tar.gz gcc-f6789c7753fa2305592d2f0db5c14d23dc78700b.tar.bz2 |
(simplify_shift_const): Don't change SHIFT_MODE for LSHIFTRT either.
From-SVN: r9650
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/combine.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 229479f..68e91f9 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7641,10 +7641,12 @@ simplify_shift_const (x, code, result_mode, varop, count) code = ROTATE, count = GET_MODE_BITSIZE (result_mode) - count; /* We need to determine what mode we will do the shift in. If the - shift is a ASHIFTRT or ROTATE, we must always do it in the mode it - was originally done in. Otherwise, we can do it in MODE, the widest - mode encountered. */ - shift_mode = (code == ASHIFTRT || code == ROTATE ? result_mode : mode); + shift is a right shift or a ROTATE, we must always do it in the mode + it was originally done in. Otherwise, we can do it in MODE, the + widest mode encountered. */ + shift_mode + = (code == ASHIFTRT || code == LSHIFTRT || code == ROTATE + ? result_mode : mode); /* Handle cases where the count is greater than the size of the mode minus 1. For ASHIFT, use the size minus one as the count (this can @@ -8185,11 +8187,13 @@ simplify_shift_const (x, code, result_mode, varop, count) } /* We need to determine what mode to do the shift in. If the shift is - a ASHIFTRT or ROTATE, we must always do it in the mode it was originally - done in. Otherwise, we can do it in MODE, the widest mode encountered. - The code we care about is that of the shift that will actually be done, - not the shift that was originally requested. */ - shift_mode = (code == ASHIFTRT || code == ROTATE ? result_mode : mode); + a right shift or ROTATE, we must always do it in the mode it was + originally done in. Otherwise, we can do it in MODE, the widest mode + encountered. The code we care about is that of the shift that will + actually be done, not the shift that was originally requested. */ + shift_mode + = (code == ASHIFTRT || code == LSHIFTRT || code == ROTATE + ? result_mode : mode); /* We have now finished analyzing the shift. The result should be a shift of type CODE with SHIFT_MODE shifting VAROP COUNT places. If |