aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-05-02 12:43:15 +0000
committerRichard Stallman <rms@gnu.org>1993-05-02 12:43:15 +0000
commit2e794ee866f33007c5759bbb3b8d1f970b35adaa (patch)
treeded0d90e309dc81fc04febbb338027d67648afad /gcc
parent64685ffacf290aca816acc9a044bfa6ea0cc0725 (diff)
downloadgcc-2e794ee866f33007c5759bbb3b8d1f970b35adaa.zip
gcc-2e794ee866f33007c5759bbb3b8d1f970b35adaa.tar.gz
gcc-2e794ee866f33007c5759bbb3b8d1f970b35adaa.tar.bz2
(record_jump_cond): Use mode of op0 or op1, not MODE,
when testing for narrowing or widening subregs. From-SVN: r4301
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cse.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 2cb9e55..64d55f0 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5490,8 +5490,10 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
true for all smaller modes whether or not there is a SUBREG, but
is not worth testing for with no SUBREG. */
+ /* Note that GET_MODE (op0) may not equal MODE. */
if (code == EQ && GET_CODE (op0) == SUBREG
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0))))
+ && (GET_MODE_SIZE (GET_MODE (op0))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))))
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0));
rtx tem = gen_lowpart_if_possible (inner_mode, op1);
@@ -5502,7 +5504,8 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
}
if (code == EQ && GET_CODE (op1) == SUBREG
- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1))))
+ && (GET_MODE_SIZE (GET_MODE (op1))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1)))))
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op1));
rtx tem = gen_lowpart_if_possible (inner_mode, op0);
@@ -5515,9 +5518,14 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
/* Similarly, if this is an NE comparison, and either is a SUBREG
making a smaller mode, we know the whole thing is also NE. */
+ /* Note that GET_MODE (op0) may not equal MODE;
+ if we test MODE instead, we can get an infinite recursion
+ alternating between two modes each wider than MODE. */
+
if (code == NE && GET_CODE (op0) == SUBREG
&& subreg_lowpart_p (op0)
- && GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0))))
+ && (GET_MODE_SIZE (GET_MODE (op0))
+ < GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))))
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0));
rtx tem = gen_lowpart_if_possible (inner_mode, op1);
@@ -5529,7 +5537,8 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality)
if (code == NE && GET_CODE (op1) == SUBREG
&& subreg_lowpart_p (op1)
- && GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1))))
+ && (GET_MODE_SIZE (GET_MODE (op1))
+ < GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1)))))
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op1));
rtx tem = gen_lowpart_if_possible (inner_mode, op0);