public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/13608] New: [3.3 regression] Incorrect code with -O3 -ffast-math
@ 2004-01-07 21:15 roger at eyesopen dot com
  2004-01-07 21:17 ` [Bug optimization/13608] " roger at eyesopen dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: roger at eyesopen dot com @ 2004-01-07 21:15 UTC (permalink / raw)
  To: gcc-bugs

The attached C++ code produces incorrect (different) results when compiled with
"-O3 -ffast-math" (and "-O2 -finline-functions -ffast-math") than it does when
compiled with just "-O3" or with "-O2 -ffast-math".  The problem appears in
both gcc 3.3.2 and the current gcc-3_3-branch (3.3.3 prerelease), but works
correctly on mainline, gcc 3.3, and gcc 3.2.x.

Even minor changes to this reduced testcase seem to allow the problem to
disappear.  Removing the "throw ()" attribute from sin and cos fixes the
problem.  Using, "extern "C" double sin(double);" and "extern "C" double
cos(double);", i.e. GCC's builtins, fixes the problem.  Even changing the
alloca's to mallocs fixes the problem!!

I'm filing the PR so that the regression hunters can identify both the
patch that introduced this regression between 3.3 and 3.3.2, and also
the patch that fixed it between 3.3 and current mainline.

[Attachment to follow!]

-- 
           Summary: [3.3 regression] Incorrect code with -O3 -ffast-math
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: roger at eyesopen dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13608


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-01-27 13:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07 21:15 [Bug optimization/13608] New: [3.3 regression] Incorrect code with -O3 -ffast-math roger at eyesopen dot com
2004-01-07 21:17 ` [Bug optimization/13608] " roger at eyesopen dot com
2004-01-07 23:04 ` pinskia at gcc dot gnu dot org
2004-01-08 17:11 ` roger at eyesopen dot com
2004-01-11 13:55 ` roger at eyesopen dot com
2004-01-15 14:52 ` roger at eyesopen dot com
2004-01-16  0:04 ` [Bug target/13608] " pinskia at gcc dot gnu dot org
2004-01-16 18:54 ` cvs-commit at gcc dot gnu dot org
2004-01-16 18:55 ` cvs-commit at gcc dot gnu dot org
2004-01-16 19:01 ` cvs-commit at gcc dot gnu dot org
2004-01-16 19:02 ` [Bug target/13608] i686-pc-linux-gnu hubicka at gcc dot gnu dot org
2004-01-27 13:06 ` [Bug target/13608] [3.3 regression] Incorrect code with -O3 -ffast-math cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).