diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-23 02:15:16 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-23 02:15:16 +0000 |
commit | 28f88c09f1fbc5d15e0c119c0fdd76f601a47090 (patch) | |
tree | 8829e87537d81b928913492b165b91a772916d7d /gcc/emit-rtl.c | |
parent | fd48ced8b9a7a458c52f8f35fe1cef0c154c4a45 (diff) | |
download | gcc-28f88c09f1fbc5d15e0c119c0fdd76f601a47090.tar.gz |
PR rtl-optimization/14838
* emit-rtl.c (get_first_nonnote_insn): Don't assume first insn is a
note.
(get_last_nonnote_insn): Don't assume last insn is a note.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91065 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 051dd152d15..5f2d8b262a3 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2738,15 +2738,9 @@ get_last_insn_anywhere (void) rtx get_first_nonnote_insn (void) { - rtx insn = first_insn; - - while (insn) - { - insn = next_insn (insn); - if (insn == 0 || !NOTE_P (insn)) - break; - } + rtx insn; + for (insn = first_insn; insn && NOTE_P (insn); insn = next_insn (insn)); return insn; } @@ -2756,15 +2750,9 @@ get_first_nonnote_insn (void) rtx get_last_nonnote_insn (void) { - rtx insn = last_insn; - - while (insn) - { - insn = previous_insn (insn); - if (insn == 0 || !NOTE_P (insn)) - break; - } + rtx insn; + for (insn = last_insn; insn && NOTE_P (insn); insn = previous_insn (insn)); return insn; } |