https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95226
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:9b8e82ab45d1ad976a824cfd7c9bd2640c8bc8e3 commit r13-8282-g9b8e82ab45d1ad976a824cfd7c9bd2640c8bc8e3 Author: Jason Merrill <ja...@redhat.com> Date: Thu Jun 1 14:41:07 2023 -0400 varasm: check float size [PR109359] In PR95226, the testcase was failing because we tried to output_constant a NOP_EXPR to float from a double REAL_CST, and so we output a double where the caller wanted a float. That doesn't happen anymore, but with the output_constant hunk we will ICE in that situation rather than emit the wrong number of bytes. Part of the problem was that initializer_constant_valid_p_1 returned true for that NOP_EXPR, because it compared the sizes of integer types but not floating-point types. So the C++ front end assumed it didn't need to fold the initializer. This also fixed the test for PR109359. PR c++/95226 PR c++/109359 gcc/ChangeLog: * varasm.cc (output_constant) [REAL_TYPE]: Check that sizes match. (initializer_constant_valid_p_1): Compare float precision. gcc/testsuite/ChangeLog: * g++.dg/ext/frounding-math1.C: New test. (cherry picked from commit e7cc4d703bceb9095316c106eba0d1939c6c8044)