Fix fortran failure reported by Craig Burley.
authorJim Wilson <wilson@cygnus.com>
Tue, 21 Apr 1998 19:43:55 +0000 (19:43 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 21 Apr 1998 19:43:55 +0000 (12:43 -0700)
* stmt.c (check_seenlabel): When search for line number note for
warning, handle case where there is no such note.

From-SVN: r19364

gcc/ChangeLog
gcc/stmt.c

index 58dc7f73864d93063807dd6cf4c5ac17c2996abd..779e3c6897eaa66bc070f09795b2cae2dc884ecf 100644 (file)
@@ -1,3 +1,8 @@
+1998-04-21  Jim Wilson  <wilson@cygnus.com>
+
+       * stmt.c (check_seenlabel): When search for line number note for
+       warning, handle case where there is no such note.
+
 Tue Apr 21 20:48:37 1998  John Carr  <jfc@mit.edu>
 
        * genemit.c (gen_exp): Allow machine description to set mode of
index d4ff2e690365e4e2153846119b5492a1cb465673..19f3e37b08aba66cb732eb6748eb895b5b31e287 100644 (file)
@@ -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;
            }
        }