https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113581
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2024-01-24
Status|UNCONFIRMED |NEW
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. The reason is we're seeing
<bb 4> :
i.2_3 = i;
i = i.2_3 + 1;
_4 = i.2_3 <= 2;
D.2811 = .ANNOTATE (_4, 1, 16);
retval.1 = D.2811;
if (retval.1 != 0)
goto <bb 3>; [INV]
else
goto <bb 5>; [INV]
and the .ANNOTATE is not directly peceeding the condition but the assign
is in the way.
The FE generates
if (<<cleanup_point ANNOTATE_EXPR <i++ <= 2, unroll 16>>>) goto <D.2807>;
else goto <D.2805>;
for some reason this forces an extra temporary via voidify_wrapper_expr ()
during gimplification.
Possibly the frontend simply lacks knowledge of ANNOTATE_EXPR when
checking whether it needs this cleanup_point at all (but I see
it's too simplistic, checking for side-effects only).
We could walk simple assigns like those of course, but the extra
temporary looks superfluous.