@@ -1315,6 +1315,11 @@ c_parser_gimple_if_stmt (c_parser *parser, gimple_seq *seq)
loc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
label = c_parser_peek_token (parser)->value;
+ if (! label)
+ {
+ c_parser_error (parser, "expected label");
+ return;
+ }
t_label = lookup_label_for_goto (loc, label);
c_parser_consume_token (parser);
if (! c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>"))
@@ -1339,6 +1344,11 @@ c_parser_gimple_if_stmt (c_parser *parser, gimple_seq *seq)
loc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
label = c_parser_peek_token (parser)->value;
+ if (! label)
+ {
+ c_parser_error (parser, "expected label");
+ return;
+ }
f_label = lookup_label_for_goto (loc, label);
c_parser_consume_token (parser);
if (! c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>"))
new file mode 100644
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-fgimple" } */
+
+__GIMPLE() void fn1() {
+ if (1)
+ goto
+} /* { dg-error "expected label" } */
new file mode 100644
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-fgimple" } */
+
+__GIMPLE() void fn1() {
+ if (1)
+ goto lbl;
+ else
+ goto
+} /* { dg-error "expected label" } */