[Bug target/50396] New: SSE division by zero generates incorrect code with optimizations enabled

mathias at gaunard dot com gcc-bugzilla@gcc.gnu.org
Wed Sep 14 16:20:00 GMT 2011


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

             Bug #: 50396
           Summary: SSE division by zero generates incorrect code with
                    optimizations enabled
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mathias@gaunard.com


Created attachment 25273
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25273
divide by zero example

The attached C code, written using SSE intrinsics, prints -nan when no
optimizations are used (as expected) and 0 otherwise.

It seems constant folding of the divps instruction doesn't do the right thing.

It works correctly when the first argument is non-zero though (including minus
zero).



More information about the Gcc-bugs mailing list