[Bug middle-end/19779] IBM 128bit long double format is not constant folded.

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 9 17:53:36 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19779

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |redi at gcc dot gnu.org

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think this should be rejects-valid not a missed-optimization enhancement. For
C++20 we reject valid code:

#include <limits>
constexpr long double x = 1.0L + std::numeric_limits<long double>::epsilon();

<stdin>:1:32: error: ‘(1.0e+0l + 4.94065645841246544176568792868221e-324l)’ is
not a constant expression


The code reduces to:

constexpr long double x = 1.0L + __LDBL_EPSILON__;


More information about the Gcc-bugs mailing list