[Bug tree-optimization/70547] Optimize multiplication of booleans to bit_and

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 5 19:19:00 GMT 2016


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

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
In this case, the code was deliberately written this way, presumably to avoid
the branching in &&. Using & would be better (and that's what I am suggesting
we optimize it to), but * doesn't seem nonsensical to me. (we can still add a
warning if you want)

PR 45780 seems to be about something completely different, and the code here
would not trigger the warning requested there (the result is the same if we
replace bool by int everywhere).


More information about the Gcc-bugs mailing list