This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/65307] Incorrect optimization breaks basic arithmetic


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]