@@ -1046,6 +1046,15 @@ c_parser_gimple_pass_list (c_parser *parser)
if (! c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>"))
return NULL;
+ if (pass)
+ {
+ char *full_passname = concat ("tree-", pass, NULL);
+ opt_pass *p = g->get_passes ()->get_pass_by_name (full_passname);
+ if (!p || p->type != GIMPLE_PASS)
+ error_at (c_parser_peek_token (parser)->location,
+ "%s is not a valid GIMPLE pass\n", pass);
+ free (full_passname);
+ }
return pass;
}
new file mode 100644
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fgimple" } */
+
+void __GIMPLE (startwith ("combine")) foo () /* { dg-error "not a valid GIMPLE pass" } */
+{
+ return;
+}