summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-23 23:28:56 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-23 23:28:56 +0000
commitcfa1a80db18ce9025feaf483c38f3f7be264e5cc (patch)
treec62c104fd3a91e71cd31b74c847e07b9389b57ab
parentfec27df5a01d6cedcc8147efc75649d26599e5e3 (diff)
downloadppe42-gcc-cfa1a80db18ce9025feaf483c38f3f7be264e5cc.tar.gz
ppe42-gcc-cfa1a80db18ce9025feaf483c38f3f7be264e5cc.zip
* cse.c (record_jump_cond_subreg): New.
(record_jump_cond): Use it instead of gen_lowpart. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91119 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cse.c48
2 files changed, 33 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 81149d2f80a..155e79759a1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-23 Richard Henderson <rth@redhat.com>
+
+ * cse.c (record_jump_cond_subreg): New.
+ (record_jump_cond): Use it instead of gen_lowpart.
+
2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
diff --git a/gcc/cse.c b/gcc/cse.c
index 4e35b346987..0858b0252b8 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4335,6 +4335,18 @@ record_jump_equiv (rtx insn, int taken)
record_jump_cond (code, mode, op0, op1, reversed_nonequality);
}
+/* Yet another form of subreg creation. In this case, we want something in
+ MODE, and we should assume OP has MODE iff it is naturally modeless. */
+
+static rtx
+record_jump_cond_subreg (enum machine_mode mode, rtx op)
+{
+ enum machine_mode op_mode = GET_MODE (op);
+ if (op_mode == mode || op_mode == VOIDmode)
+ return op;
+ return lowpart_subreg (mode, op, op_mode);
+}
+
/* We know that comparison CODE applied to OP0 and OP1 in MODE is true.
REVERSED_NONEQUALITY is nonzero if CODE had to be swapped.
Make any useful entries we can with that information. Called from
@@ -4359,11 +4371,10 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0,
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))))
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0));
- rtx tem = gen_lowpart (inner_mode, op1);
-
- record_jump_cond (code, mode, SUBREG_REG (op0),
- tem ? tem : gen_rtx_SUBREG (inner_mode, op1, 0),
- reversed_nonequality);
+ rtx tem = record_jump_cond_subreg (inner_mode, op1);
+ if (tem)
+ record_jump_cond (code, mode, SUBREG_REG (op0), tem,
+ reversed_nonequality);
}
if (code == EQ && GET_CODE (op1) == SUBREG
@@ -4371,11 +4382,10 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0,
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1)))))
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op1));
- rtx tem = gen_lowpart (inner_mode, op0);
-
- record_jump_cond (code, mode, SUBREG_REG (op1),
- tem ? tem : gen_rtx_SUBREG (inner_mode, op0, 0),
- reversed_nonequality);
+ rtx tem = record_jump_cond_subreg (inner_mode, op0);
+ if (tem)
+ record_jump_cond (code, mode, SUBREG_REG (op1), tem,
+ reversed_nonequality);
}
/* Similarly, if this is an NE comparison, and either is a SUBREG
@@ -4391,11 +4401,10 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0,
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))))
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0));
- rtx tem = gen_lowpart (inner_mode, op1);
-
- record_jump_cond (code, mode, SUBREG_REG (op0),
- tem ? tem : gen_rtx_SUBREG (inner_mode, op1, 0),
- reversed_nonequality);
+ rtx tem = record_jump_cond_subreg (inner_mode, op1);
+ if (tem)
+ record_jump_cond (code, mode, SUBREG_REG (op0), tem,
+ reversed_nonequality);
}
if (code == NE && GET_CODE (op1) == SUBREG
@@ -4404,11 +4413,10 @@ record_jump_cond (enum rtx_code code, enum machine_mode mode, rtx op0,
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (op1)))))
{
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op1));
- rtx tem = gen_lowpart (inner_mode, op0);
-
- record_jump_cond (code, mode, SUBREG_REG (op1),
- tem ? tem : gen_rtx_SUBREG (inner_mode, op0, 0),
- reversed_nonequality);
+ rtx tem = record_jump_cond_subreg (inner_mode, op0);
+ if (tem)
+ record_jump_cond (code, mode, SUBREG_REG (op1), tem,
+ reversed_nonequality);
}
/* Hash both operands. */
OpenPOWER on IntegriCloud