https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86769
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #16 from Jason Merrill <jason at gcc dot gnu.org> --- I think Marek was on the right track: in genericize_c_loop, if body is a BIND_EXPR, we want that BIND_EXPR to enclose cond and incr as well. This transformation can replace the one done by simplify_loop_decl_cond. But his comment #5 testcase demonstrates that we need a separate BIND_EXPR for the condition variable to distinguish it from the BIND_EXPR representing the compound-statement. There would need to be a flag either on the loop or the BIND_EXPR to control this transformation.