summaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-04 01:21:56 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-04 01:21:56 +0000
commite4220e08ff9d64f8d992cd61cb1d600594c0f81b (patch)
treeae1ea1dc2bebea2da16c63c26850e910f8520487 /gcc/jump.c
parentcadb19f1bb9811d4f939924178df3cfb0c6ad864 (diff)
downloadgcc-e4220e08ff9d64f8d992cd61cb1d600594c0f81b.tar.gz
PR c/10175
* jump.c (never_reached_warning): Revert patch of 2002-11-02. Look backwards for a line note. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65227 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 6e047908158..b48bc6b0347 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1909,10 +1909,20 @@ never_reached_warning (avoided_insn, finish)
if (!warn_notreached)
return;
+ /* 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)
+ {
+ insn = NEXT_INSN (insn);
+ break;
+ }
+
/* Scan forwards, looking at LINE_NUMBER notes, until we hit a LABEL
in case FINISH is NULL, otherwise until we run out of insns. */
- for (insn = avoided_insn; insn != NULL; insn = NEXT_INSN (insn))
+ for (; insn != NULL; insn = NEXT_INSN (insn))
{
if ((finish == NULL && GET_CODE (insn) == CODE_LABEL)
|| GET_CODE (insn) == BARRIER)
@@ -1929,7 +1939,7 @@ never_reached_warning (avoided_insn, finish)
}
else if (INSN_P (insn))
{
- if (reached_end || a_line_note == NULL)
+ if (reached_end)
break;
contains_insn = 1;
}