https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117741
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:e9f3eb8493c66da143561d6b866c4b3204e42574 commit r15-5633-ge9f3eb8493c66da143561d6b866c4b3204e42574 Author: Andrew Pinski <quic_apin...@quicinc.com> Date: Sat Nov 23 13:42:47 2024 -0800 gimplefe: Fix handling of ')'/'}' after a parse error [PR117741] The problem here is c_parser_skip_until_found stops at a closing nesting delimiter without consuming it. So if we don't consume it in c_parser_gimple_compound_statement, we would go into an infinite loop. The C parser similar code in c_parser_statement_after_labels to handle this specific case too. PR c/117741 gcc/c/ChangeLog: * gimple-parser.cc (c_parser_gimple_compound_statement): Handle CPP_CLOSE_PAREN/CPP_CLOSE_SQUARE with an error and skipping the token. gcc/testsuite/ChangeLog: * gcc.dg/gimplefe-54.c: New test. Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>