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/15470] New: Incorrect floating-point generation on Pentium 4 with -mno-fp-ret-in-387


The attached program incorrectly computes double values when compiled with the
GCC mainline (3.5 20040514) command:

    gcc -lrt -lm -std=gnu99 -DVERIFY -DACOVEA -O1 -o evo -mno-fp-ret-in-387
coybench_evo.c

The above produces incorrect output of:
    best = ( -0.495,  0.497)

Correct output is (approximately:
    best = ( -0.495,  0.497)

Since this is beign compiled on a machine with an integrated hardware math
coprocessor (a Pentium 4), this option probably wouldn't be used. I ran across
this while doing Acovea runs with the attached benchmark. This is not a priority
in and of itself, but it might indicate a more troublesome problem elsewhere in
the compiler.

I note that correct code is generated for the x86_64, probably because the
Opteron has 64-bit registers to hold 64-bit doubles. But that's just
speculation... if I get some time, I'll generate some assembler and see what's
going wrong on the P4.

-- 
           Summary: Incorrect floating-point generation on Pentium 4 with -
                    mno-fp-ret-in-387
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: coyote at coyotegulch dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux
  GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux


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


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