Commit 9547e8fd by Jason Merrill Committed by Jason Merrill

PR middle-end/10336, c++/10401

        PR middle-end/10336, c++/10401
        * jump.c (never_reached_warning): Also stop looking if we reach the
        beginning of the function.

From-SVN: r65637
parent 55adc7bd
2003-04-14 Jason Merrill <jason@redhat.com>
PR middle-end/10336, c++/10401
* jump.c (never_reached_warning): Also stop looking if we reach the
beginning of the function.
2003-04-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-04-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR target/10338 PR target/10338
......
...@@ -1913,7 +1913,8 @@ never_reached_warning (avoided_insn, finish) ...@@ -1913,7 +1913,8 @@ never_reached_warning (avoided_insn, finish)
us the head of a block, a NOTE_INSN_BASIC_BLOCK, which often follows us the head of a block, a NOTE_INSN_BASIC_BLOCK, which often follows
the line note. */ the line note. */
for (insn = PREV_INSN (avoided_insn); ; insn = PREV_INSN (insn)) for (insn = PREV_INSN (avoided_insn); ; insn = PREV_INSN (insn))
if (GET_CODE (insn) != NOTE) if (GET_CODE (insn) != NOTE
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
{ {
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
break; break;
......
/* PR middle-end/10336 */
/* { dg-options "-Wunreachable-code" } */
void foo(int i)
{
switch(i) {
case 0:
break;
case 1:
break;
}
}
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