https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116453
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Component|tree-optimization |middle-end Keywords| |missed-optimization --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- C++20 you should just use std::bitcast: ``` constexpr float operator""_F(unsigned long long int float_data) { return std::bit_cast<float> ((int)float_data); } ``` And this gets optimized correctly.