aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom Wood <wood@gnu.org>1992-08-13 20:49:10 +0000
committerTom Wood <wood@gnu.org>1992-08-13 20:49:10 +0000
commit109140655e4230e3efa1ec489dd46d815f1b82e1 (patch)
tree4731903d512ba5c3c67838d02fbf1abd9aded41a /gcc
parente5ed215546e9bdc14a4ae1b537822ecfd6a708b6 (diff)
downloadgcc-109140655e4230e3efa1ec489dd46d815f1b82e1.zip
gcc-109140655e4230e3efa1ec489dd46d815f1b82e1.tar.gz
gcc-109140655e4230e3efa1ec489dd46d815f1b82e1.tar.bz2
(contains): Return the number of insns.
(reposition_prologue_and_epilogue_notes): Count all the prologue and epilogue insns. From-SVN: r1814
Diffstat (limited to 'gcc')
-rw-r--r--gcc/function.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/function.c b/gcc/function.c
index df2bffa..685fcc386 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4278,9 +4278,9 @@ record_insns (insns)
return vec;
}
-/* Determine whether INSN is in the array of INSN_UIDs VEC. */
+/* Determine how many INSN_UIDs in VEC are part of INSN. */
-static rtx
+static int
contains (insn, vec)
rtx insn;
int *vec;
@@ -4290,16 +4290,18 @@ contains (insn, vec)
if (GET_CODE (insn) == INSN
&& GET_CODE (PATTERN (insn)) == SEQUENCE)
{
+ int count = 0;
for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--)
for (j = 0; vec[j]; j++)
if (INSN_UID (XVECEXP (PATTERN (insn), 0, i)) == vec[j])
- return XVECEXP (PATTERN (insn), 0, i);
+ count++;
+ return count;
}
else
{
for (j = 0; vec[j]; j++)
if (INSN_UID (insn) == vec[j])
- return insn;
+ return 1;
}
return 0;
}
@@ -4411,7 +4413,7 @@ reposition_prologue_and_epilogue_notes (f)
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PROLOGUE_END)
note = insn;
}
- else if (contains (insn, prologue) && --len == 0)
+ else if ((len -= contains (insn, prologue)) == 0)
{
/* Find the prologue-end note if we haven't already, and
move it to just after the last prologue insn. */
@@ -4446,7 +4448,7 @@ reposition_prologue_and_epilogue_notes (f)
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EPILOGUE_BEG)
note = insn;
}
- else if (contains (insn, epilogue) && --len == 0)
+ else if ((len -= contains (insn, epilogue)) == 0)
{
/* Find the epilogue-begin note if we haven't already, and
move it to just before the first epilogue insn. */