https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125442
Souradipto Das <souradiptodas6 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |souradiptodas6 at gmail dot com
--- Comment #3 from Souradipto Das <souradiptodas6 at gmail dot com> ---
Created attachment 64563
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64563&action=edit
Fix missed optimization via match.pd pattern and add live verification testcase
I've attached a patch containing a match.pd simplification rule that resolves
this missed optimization.
The rule successfully catches and collapses the redundant bitwise chain down to
the expected single comparison. Tested locally on x86_64-pc-linux-gnu via `make
check-gcc` using the literal testcase provided in the description, yielding 3
expected passes with zero regressions.
### Verified Optimized GIMPLE Output:
_Bool src (long unsigned int x, long unsigned int y)
{
_Bool _10;
<bb 2>:
_10_3 = x_1(D) == 0;
return _10_3;
}