The first problem happens because we don't check for missing labels when parsing 'goto' statements. I.e.: __GIMPLE() void fn1() { if (1) goto } The fix is pretty obvious: just add a check. My question is: which functions should I use to produce diagnostics? The surrounding code uses 'c_parser_error', but this function does not handle locations very well (in fact, it uses input_location). -- Regards, Mikhail Maltsev gcc/testsuite/ChangeLog: 2017-05-01 Mikhail Maltsev * gcc.dg/gimplefe-error-4.c: New test. * gcc.dg/gimplefe-error-5.c: New test. gcc/c/ChangeLog: 2017-05-01 Mikhail Maltsev * gimple-parser.c (c_parser_gimple_if_stmt): Check for empty labels.