https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104376
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=101822,
| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=99997,
| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=71016
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> cond_removal_in_builtin_zero_pattern should have optimized the above but
> does not for some reason.
> Let me take a look.
So one problem is we have:
<bb 2> [local count: 1073741824]:
if (x_3(D) == 0)
goto <bb 4>; [21.72%]
else
goto <bb 3>; [78.28%]
<bb 3> [local count: 840525097]:
_1 = __builtin_clz (x_3(D));
_4 = (uint32_t) _1;
<bb 4> [local count: 1073741824]:
# _2 = PHI <32(2), _4(3)>
Which we don't handle in cond_removal_in_builtin_zero_pattern, this similar to
PR 99997 and PR 101822, that is the code which added to fix PR 71016 is getting
in the way.