[Bug c/65307] Incorrect optimization breaks basic arithmetic

madars+gccbug at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 4 08:33:00 GMT 2015


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

--- Comment #1 from madars+gccbug at gmail dot com ---
I should clarify that the same behavior can be observed on Debian, Ubuntu and
Fedora:

gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
gcc (Debian 4.9.1-19) 4.9.1
gcc (GCC) 4.9.2 20141101 (Red Hat 4.9.2-1)

Moreover, Alex Chernyakhovsky reports that switching two() * 2 to two() + two()
or two() << 1 produces correct results, so this seems to have to do with the
handling of multiplication.



More information about the Gcc-bugs mailing list