diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr80706.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr80706.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr80706.c b/gcc/testsuite/gcc.target/i386/pr80706.c new file mode 100644 index 00000000000..7cc1b8f57b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr80706.c @@ -0,0 +1,30 @@ +/* PR target/80706 */ +/* { dg-do run { target sse2_runtime } } */ +/* { dg-options "-O2 -msse2" } */ + +union U { double value; struct S { int lsw; int msw; } parts; }; + +__attribute__((noinline, noclone)) double +foo (void) +{ + __asm volatile ("" : : : "memory"); + return 2.0; +} + +__attribute__((noinline, noclone)) double +bar (void) +{ + double s = foo (); + union U z; + z.value = s; + z.parts.lsw = 0; + return z.value * z.value + s * s; +} + +int +main () +{ + if (bar () != 8.0) + __builtin_abort (); + return 0; +} |