This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/65307] Incorrect optimization breaks basic arithmetic
- From: "madars+gccbug at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Mar 2015 08:33:50 +0000
- Subject: [Bug c/65307] Incorrect optimization breaks basic arithmetic
- Auto-submitted: auto-generated
- References: <bug-65307-4 at http dot gcc dot gnu dot org/bugzilla/>
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.