+2017-05-31 Mikhail Maltsev <maltsevm@gmail.com>
+
+ PR testsuite/80580
+ * gimple-parser.c (c_parser_gimple_if_stmt): Check for empty labels.
+
2017-05-30 David Malcolm <dmalcolm@redhat.com>
* c-objc-common.c (c_tree_printer): Gain bool and const char **
{
loc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
+ if (! c_parser_next_token_is (parser, CPP_NAME))
+ {
+ c_parser_error (parser, "expected label");
+ return;
+ }
label = c_parser_peek_token (parser)->value;
- t_label = lookup_label_for_goto (loc, label);
c_parser_consume_token (parser);
+ t_label = lookup_label_for_goto (loc, label);
if (! c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>"))
return;
}
{
loc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
+ if (! c_parser_next_token_is (parser, CPP_NAME))
+ {
+ c_parser_error (parser, "expected label");
+ return;
+ }
label = c_parser_peek_token (parser)->value;
f_label = lookup_label_for_goto (loc, label);
c_parser_consume_token (parser);
+2017-05-31 Mikhail Maltsev <maltsevm@gmail.com>
+
+ PR testsuite/80580
+ * gcc.dg/gimplefe-error-7.c: New test.
+
2017-05-31 Graham Markall <graham.markall@embecosm.com>
* gcc.target/arc/add_n-combine.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fgimple" } */
+
+__GIMPLE() void fn1()
+{
+ if (1)
+ goto
+ else /* { dg-error "expected label" } */
+ goto lbl;
+}
+
+__GIMPLE() void fn2()
+{
+ if (1)
+ goto lbl;
+ else
+ goto ; /* { dg-error "expected label" } */
+}
+
+__GIMPLE() void fn3()
+{
+ if (1)
+ goto lbl;
+ else
+ goto
+} /* { dg-error "expected label" } */
+