Commit b6553814 by Steven Bosscher Committed by Andreas Jaeger

re PR c/8828 (gcc reports some code is unreachable when it is not)

2003-02-22  Steven Bosscher  <s.bosscher@student.tudelft.nl>

	PR c/8828
	* jump.c (never_reached_warning): Don't fall through BARRRIER
	insns.  Update comments to reflect what the function really does.

From-SVN: r63275
parent 26182e15
...@@ -1893,14 +1893,14 @@ delete_for_peephole (from, to) ...@@ -1893,14 +1893,14 @@ delete_for_peephole (from, to)
is also an unconditional jump in that case. */ is also an unconditional jump in that case. */
} }
/* We have determined that INSN is never reached, and are about to /* We have determined that AVOIDED_INSN is never reached, and are
delete it. Print a warning if the user asked for one. about to delete it. If the insn chain between AVOIDED_INSN and
FINISH contains more than one line from the current function, and
contains at least one operation, print a warning if the user asked
for it. If FINISH is NULL, look between AVOIDED_INSN and a LABEL.
To try to make this warning more useful, this should only be called CSE and inlining can duplicate insns, so it's possible to get
once per basic block not reached, and it only warns when the basic spurious warnings from this. */
block contains more than one line from the current function, and
contains at least one operation. CSE and inlining can duplicate insns,
so it's possible to get spurious warnings from this. */
void void
never_reached_warning (avoided_insn, finish) never_reached_warning (avoided_insn, finish)
...@@ -1910,15 +1910,16 @@ never_reached_warning (avoided_insn, finish) ...@@ -1910,15 +1910,16 @@ never_reached_warning (avoided_insn, finish)
rtx a_line_note = NULL; rtx a_line_note = NULL;
int two_avoided_lines = 0, contains_insn = 0, reached_end = 0; int two_avoided_lines = 0, contains_insn = 0, reached_end = 0;
if (! warn_notreached) if (!warn_notreached)
return; return;
/* Scan forwards, looking at LINE_NUMBER notes, until /* Scan forwards, looking at LINE_NUMBER notes, until we hit a LABEL
we hit a LABEL or we run out of insns. */ in case FINISH is NULL, otherwise until we run out of insns. */
for (insn = avoided_insn; insn != NULL; insn = NEXT_INSN (insn)) for (insn = avoided_insn; insn != NULL; insn = NEXT_INSN (insn))
{ {
if (finish == NULL && GET_CODE (insn) == CODE_LABEL) if ((finish == NULL && GET_CODE (insn) == CODE_LABEL)
|| GET_CODE (insn) == BARRIER)
break; break;
if (GET_CODE (insn) == NOTE /* A line number note? */ if (GET_CODE (insn) == NOTE /* A line number note? */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment