http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57034
Bug #: 57034 Summary: ternary operator with float infinity in O0 Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: christopher.h...@jpmorgan.com std::numeric_limits<float>::infinity() should be greater than std::numeric_limits<int32_t>::max(). The ternary operator produces a different result in O0. I would expect y to be MAX. The correct code is produced in O1+, but O0 seems to produce the wrong code. Appologies for the additonal variables, but they are useful in debugging.