summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-29 20:25:11 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-29 20:25:11 +0000
commit6a61caf26f471456744760dfcaec60d76ca0faab (patch)
tree72cefeccbafcc29fe61400e39d0ce726e6b585bb
parent26c978a1bd70c1d0308560bdf30b1574223cbe8d (diff)
downloadppe42-gcc-6a61caf26f471456744760dfcaec60d76ca0faab.tar.gz
ppe42-gcc-6a61caf26f471456744760dfcaec60d76ca0faab.zip
PR middle-end/10336
* jump.c (never_reached_warning): Really stop looking if we reach the beginning of the function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66249 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/jump.c14
2 files changed, 14 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c22b671de01..b7bb449594e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-29 Jason Merrill <jason@redhat.com>
+
+ PR middle-end/10336
+ * jump.c (never_reached_warning): Really stop looking if we reach
+ the beginning of the function.
+
2003-04-29 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/elf.h (SIZE_TYPE, PTRDIFF_TYPE, USER_LABEL_PREFIX):
diff --git a/gcc/jump.c b/gcc/jump.c
index 5563ee34581..5bed408fb5c 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1912,13 +1912,15 @@ never_reached_warning (avoided_insn, finish)
/* Back up to the first of any NOTEs preceding avoided_insn; flow passes
us the head of a block, a NOTE_INSN_BASIC_BLOCK, which often follows
the line note. */
- for (insn = PREV_INSN (avoided_insn); ; insn = PREV_INSN (insn))
- if (GET_CODE (insn) != NOTE
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
- {
- insn = NEXT_INSN (insn);
+ insn = avoided_insn;
+ while (1)
+ {
+ rtx prev = PREV_INSN (insn);
+ if (prev == NULL_RTX
+ || GET_CODE (prev) != NOTE)
break;
- }
+ insn = prev;
+ }
/* Scan forwards, looking at LINE_NUMBER notes, until we hit a LABEL
in case FINISH is NULL, otherwise until we run out of insns. */
OpenPOWER on IntegriCloud