https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104938
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-03-16
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. With -O it works, if you mark foo noinline the only difference at
RTL expansion is
@@ -25,11 +24,11 @@
# DEBUG l_3 => &b
# DEBUG BEGIN_STMT
# DEBUG e => &l_3
- a.0_1 = a;
<bb 3> [local count: 1073741824]:
f:
# DEBUG BEGIN_STMT
+ a.0_1 = a;
if (a.0_1 != 0)
goto <bb 3>; [89.00%]
else
that is, the load from a is hoisted out of the loop with -O but not with -Og
which makes the first block empty.