diff options
author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-04-21 19:43:55 +0000 |
---|---|---|
committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-04-21 19:43:55 +0000 |
commit | 11e6f5446bc3f1c7a4c734d04c81d5c55426dd36 (patch) | |
tree | 23cc828dc0b45ba19c70710fbf42a44d2b68bf6d /gcc/stmt.c | |
parent | 0cba67f4550586668c9e3c24ab8a76abf3ebc4a5 (diff) | |
download | gcc-11e6f5446bc3f1c7a4c734d04c81d5c55426dd36.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19364 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index d4ff2e69036..19f3e37b08a 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; } } |