[Bug target/122385] (x == 0 || y == 0) can optimize to (x * y == 0) for small integers in -Oz mode

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 23 09:27:13 GMT 2025


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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
This gets very tricky with machine specific costs, like whether multiplication
sets ZF or what the throughput of reg == 0 is.  So I suppose it is best handled
by a peephole2 or combiner pattern in targets?


More information about the Gcc-bugs mailing list