summaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-02 10:44:28 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-02 10:44:28 +0000
commit2f3f2ddf986ad223386f8ea7f4108de38eb72c86 (patch)
tree4d91485aa960e611410df76a5f8d37fa1dde04d2 /gcc/rtlanal.c
parent4aab44e7672c3c5058453a0d7959c7a162a32da3 (diff)
downloadgcc-2f3f2ddf986ad223386f8ea7f4108de38eb72c86.tar.gz
2004-02-02 Paolo Bonzini <bonzini@gnu.org>
* rtlanal.c (reg_overlap_mentioned_p) [!ENABLE_CHECKING]: Don't test CONSTANT_P (x). (reg_overlap_mentioned_p): Merge check for STRICT_LOWPART, ZERO_EXTRACT, SIGN_EXTRACT with the switch statement. Fix misindentation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77105 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 856af2f3a78..3744a327f20 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1520,18 +1520,22 @@ reg_overlap_mentioned_p (rtx x, rtx in)
{
unsigned int regno, endregno;
- /* Overly conservative. */
- if (GET_CODE (x) == STRICT_LOW_PART
- || GET_CODE (x) == ZERO_EXTRACT
- || GET_CODE (x) == SIGN_EXTRACT)
- x = XEXP (x, 0);
-
- /* If either argument is a constant, then modifying X can not affect IN. */
- if (CONSTANT_P (x) || CONSTANT_P (in))
+ /* If either argument is a constant, then modifying X can not
+ affect IN. Here we look at IN, we can profitably combine
+ CONSTANT_P (x) with the switch statement below. */
+ if (CONSTANT_P (in))
return 0;
+ recurse:
switch (GET_CODE (x))
{
+ case STRICT_LOW_PART:
+ case ZERO_EXTRACT:
+ case SIGN_EXTRACT:
+ /* Overly conservative. */
+ x = XEXP (x, 0);
+ goto recurse;
+
case SUBREG:
regno = REGNO (SUBREG_REG (x));
if (regno < FIRST_PSEUDO_REGISTER)
@@ -1574,15 +1578,18 @@ reg_overlap_mentioned_p (rtx x, rtx in)
for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
if (XEXP (XVECEXP (x, 0, i), 0) != 0
&& reg_overlap_mentioned_p (XEXP (XVECEXP (x, 0, i), 0), in))
- return 1;
+ return 1;
return 0;
}
default:
- break;
- }
+#ifdef ENABLE_CHECKING
+ if (!CONSTANT_P (x))
+ abort ();
+#endif
- abort ();
+ return 0;
+ }
}
/* Return the last value to which REG was set prior to INSN. If we can't