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

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)


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