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: unassig...@gcc.gnu.org ReportedBy: math...@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).