aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1993-04-01 17:38:33 -0700
committerJeff Law <law@gcc.gnu.org>1993-04-01 17:38:33 -0700
commitca104c130db31bfa029fd876932e29bd34cdad10 (patch)
tree4d3e2f38a4b878700cbf11fa329755e262a1acdc
parent2f9e2a13ecebcac5c213c7fe07d3742de8d7539a (diff)
downloadgcc-ca104c130db31bfa029fd876932e29bd34cdad10.zip
gcc-ca104c130db31bfa029fd876932e29bd34cdad10.tar.gz
gcc-ca104c130db31bfa029fd876932e29bd34cdad10.tar.bz2
reorg.c (redundant_insn_p): Stop searching for a redundant insn if an INSN or JUMP_INSN with delayed...
* reorg.c (redundant_insn_p): Stop searching for a redundant insn if an INSN or JUMP_INSN with delayed effects is encountered. From-SVN: r3989
-rw-r--r--gcc/reorg.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 787d9ff..a125a82 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -1729,11 +1729,27 @@ redundant_insn_p (insn, target, delay_list)
if (GET_CODE (pat) == SEQUENCE)
{
- /* Stop for a CALL and its delay slots because it difficult to track
- its resource needs correctly. */
+ /* Stop for a CALL and its delay slots because it is difficult to
+ track its resource needs correctly. */
if (GET_CODE (XVECEXP (pat, 0, 0)) == CALL_INSN)
return 0;
+ /* Stop for an INSN or JUMP_INSN with delayed effects and its delay
+ slots because it is difficult to track its resource needs
+ correctly. */
+
+#ifdef INSN_SETS_ARE_DELAYED
+ if (INSN_SETS_ARE_DELAYED (XVECEXP (pat, 0, 0)))
+ return 0;
+#endif
+
+#ifdef INSN_REFERENCES_ARE_DELAYED
+ if (INSN_REFERENCES_ARE_DELAYED (XVECEXP (pat, 0, 0)))
+ return 0;
+#endif
+
+ /* See if any of the insns in the delay slot match, updating
+ resource requirements as we go. */
for (i = XVECLEN (pat, 0) - 1; i > 0; i--)
if (GET_CODE (XVECEXP (pat, 0, i)) == GET_CODE (insn)
&& rtx_equal_p (PATTERN (XVECEXP (pat, 0, i)), ipat))
@@ -1816,6 +1832,19 @@ redundant_insn_p (insn, target, delay_list)
if (GET_CODE (XVECEXP (pat, 0, 0)) == CALL_INSN)
return 0;
+ /* If this this is an INSN or JUMP_INSN with delayed effects, it
+ is hard to track the resource needs properly, so give up. */
+
+#ifdef INSN_SETS_ARE_DELAYED
+ if (INSN_SETS_ARE_DELAYED (XVECEXP (pat, 0, 0)))
+ return 0;
+#endif
+
+#ifdef INSN_REFERENCES_ARE_DELAYED
+ if (INSN_REFERENCES_ARE_DELAYED (XVECEXP (pat, 0, 0)))
+ return 0;
+#endif
+
/* See if any of the insns in the delay slot match, updating
resource requirements as we go. */
for (i = XVECLEN (pat, 0) - 1; i > 0; i--)