From 0dacbd0e171bc16e917dc611f564e71cd5922d1f Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 21 Apr 1998 19:43:55 +0000 Subject: Fix fortran failure reported by Craig Burley. * stmt.c (check_seenlabel): When search for line number note for warning, handle case where there is no such note. From-SVN: r19364 --- gcc/stmt.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gcc/stmt.c') diff --git a/gcc/stmt.c b/gcc/stmt.c index d4ff2e6..19f3e37 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -3848,12 +3848,14 @@ check_seenlabel () { do insn = PREV_INSN (insn); - while (GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) < 0); - - warning_with_file_and_line (NOTE_SOURCE_FILE(insn), - NOTE_LINE_NUMBER(insn), - "unreachable code at beginning of %s", - case_stack->data.case_stmt.printname); + while (insn && (GET_CODE (insn) != NOTE || NOTE_LINE_NUMBER (insn) < 0)); + + /* If insn is zero, then there must have been a syntax error. */ + if (insn) + warning_with_file_and_line (NOTE_SOURCE_FILE(insn), + NOTE_LINE_NUMBER(insn), + "unreachable code at beginning of %s", + case_stack->data.case_stmt.printname); break; } } -- cgit v1.1