https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125442

Souradipto Das <souradiptodas6 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #64563|0                           |1
        is obsolete|                            |

--- Comment #7 from Souradipto Das <souradiptodas6 at gmail dot com> ---
Created attachment 64567
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64567&action=edit
v2 patch: Captures zero via native match.pd variables instead of C++ code, and
adds testcases for both AND/OR reduction paths.

Thanks for the discussion, Kael! 

I've attached a v2 patch that handles both the OR and AND cases using a clean
macro iterator loop in match.pd. It captures the zero constant using native
variable tracking (`integer_zerop@2`) instead of dropping into an explicit C++
block, which keeps the code much cleaner.

I also updated the testcase at gcc.dg/pr125442.c to make sure both paths
optimize down perfectly on x86_64-pc-linux-gnu. Let me know what you think!

Reply via email to