Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* { dg-do compile } */ /* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */ #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) typedef int intflt; #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) typedef long intflt; #else #error Add target support here for type that will union float size #endif union U { intflt i; float f; }; intflt foo(int i, int b) { union U u; if (b) { i = i << 2; u.i = i; return u.f; } else { i = i << 2; u.i = i; return u.f; } } /* { dg-final { scan-tree-dump-times "Replaced u.f with" 2 "fre1" } } */ /* { dg-final { scan-tree-dump-times "Inserted" 2 "fre1" } } */