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: "andersk at mit dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Mar 2015 09:20:39 +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
Anders Kaseorg <andersk at mit dot edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andersk at mit dot edu
--- Comment #2 from Anders Kaseorg <andersk at mit dot edu> ---
Confirmed, except that changing two() * 2 to two() + two() or two() << 1 does
not make a difference for me. This looks more related to inlining:
-O1: works
-O2: fails
-O1 -finline-small-functions: fails
-O2 -fno-inline-small-functions: works
And if I mark two() and six() as inline, then it fails even at -O1.
(GCC 4.9.2-10ubuntu7 on Ubuntu vivid amd64)