| 1 |
/* PR target/95450 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 4 |
/* { dg-final { scan-tree-dump-not "return \[0-9.e+]\+;" "optimized" } } */ |
| 5 |
|
| 6 |
/* Verify this is not optimized for double double into return floating_point_constant, |
| 7 |
as while that constant is the maximum normalized floating point value, it needs |
| 8 |
107 bit precision, which is more than GCC supports for this format. */ |
| 9 |
|
| 10 |
#if __LDBL_MANT_DIG__ == 106 |
| 11 |
union U |
| 12 |
{ |
| 13 |
struct { double hi; double lo; } dd; |
| 14 |
long double ld; |
| 15 |
}; |
| 16 |
|
| 17 |
const union U g = { { __DBL_MAX__, __DBL_MAX__ / (double)134217728UL / (double)134217728UL } }; |
| 18 |
#else |
| 19 |
struct S |
| 20 |
{ |
| 21 |
long double ld; |
| 22 |
} g; |
| 23 |
#endif |
| 24 |
|
| 25 |
long double |
| 26 |
foo (void) |
| 27 |
{ |
| 28 |
return g.ld; |
| 29 |
} |