c/107305 - avoid ICEing with invalid GIMPLE input to the GIMPLE FE
The GIMPLE FE was designed to defer semantic error checking to the
GIMPLE IL verifier. But that can end up causing spurious ICEs
earlier and in fact it will report an internal error. The following
tries to improve the situation by explicitely calling into the
verifier from the parser and intructing it to not ICE but instead
zap the parsed body after an error is discovered.
PR c/107305
PR c/107306
gcc/c/
* gimple-parser.cc (c_parser_parse_gimple_body): Verify
the parsed IL and zap the body on error.
gcc/
* tree-cfg.h (verify_gimple_in_seq): Add parameter to
indicate whether to emit an ICE. Add return value.
(verify_gimple_in_cfg): Likewise.
* tree-cfg.cc (verify_gimple_in_seq): Likewise.
(verify_gimple_in_cfg): Likewise.
gcc/testsuite/
* gcc.dg/gimplefe-error-15.c: New testcase.