[Bug target/122935] Missed optimization: Optimize (a * b) ==/!= 0 to logical checks for signed/widening multiplications.
law at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 19 18:36:38 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122935
Jeffrey A. Law <law at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2026-01-19
--- Comment #1 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Note that multiplers aren't *that* expensive on some designs; getting
multiplies down to 2c is possible if you're willing to burn the silicon.
I think Dongyan's suggestion is still a good one, but it's not going to be as
profitable as one might hope on some designs.
Also note you have to be careful with overflows here.
More information about the Gcc-bugs
mailing list