https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86769

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Maybe yet another possibility would be to actively look for that CLEANUP_STMT
at the end deconstruct that into multiple new {FOR,WHILE}_STMT operands;
{FOR,WHILE}_COND_PREP (the statements seen from condition processing except the
CLEANUP_STMT) and {FOR,WHILE}_COND_CLEANUP being the second operand of the
CLEANUP_STMT if any and let c-genericize.cc emit the prep sequence into the
loop, followed by TRY_FINALLY_EXPR with the cleanup and the normal condition,
body, continue label if needed and FOR_EXPR into the TRY_FINALLY_EXPR's first
operand.
That might be easier to handle in constexpr.cc...
Assuming we can have at most one such CLEANUP_STMT.

Reply via email to