blob: 569d2b2c536fe3421540da896f0d4da1a61d847c [file] [log] [blame]
/* PR target/95450 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-not "return \[0-9.e+]\+;" "optimized" } } */
/* Verify this is not optimized for double double into return floating_point_constant,
as while that constant is the maximum normalized floating point value, it needs
107 bit precision, which is more than GCC supports for this format. */
#if __LDBL_MANT_DIG__ == 106
union U
{
struct { double hi; double lo; } dd;
long double ld;
};
const union U g = { { __DBL_MAX__, __DBL_MAX__ / (double)134217728UL / (double)134217728UL } };
#else
struct S
{
long double ld;
} g;
#endif
long double
foo (void)
{
return g.ld;
}