https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78249
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2016-11-08 Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- #include <limits> double x = 0.0 * std::numeric_limits<double>::infinity(); get's me x: .long 0 .long 2146959360 independent of optimization level. But I can confirm the findings for #include <iostream> #include <limits> double y = 0.0 * std::numeric_limits<double>::infinity(); int main() { double x = 0.0 * std::numeric_limits<double>::infinity(); std::cout << "CPP runtime: " << x << std::endl; std::cout << "CPP compile-time: " << y << std::endl; } which evaluates 0.0 * std::numeric_limits<double>::infinity() at runtime via 4008fe: e8 9f 00 00 00 callq 4009a2 <_ZNSt14numeric_limitsIdE8 infinityEv> 400903: 66 0f 28 c8 movapd %xmm0,%xmm1 400907: 66 0f ef c0 pxor %xmm0,%xmm0 40090b: f2 0f 59 c1 mulsd %xmm1,%xmm0 where with optimization we simplify it to +NaN (at compile-time).