1/* { dg-do run { target i?86-*-* x86_64-*-* } } */ 2/* { dg-options "-O -fgcse -fno-split-wide-types" } */ 3 4extern void abort(void); 5 6typedef unsigned short int uint16_t; 7typedef unsigned int uint32_t; 8typedef unsigned long long uint64_t; 9 10typedef struct 11{ 12 uint16_t thread; 13 uint16_t phase; 14} s32; 15 16typedef union 17{ 18 uint32_t i; 19 s32 s; 20} u32; 21 22typedef union 23{ 24 uint64_t i; 25 u32 u; 26} u64; 27 28static __attribute__((noinline)) 29void foo(int val) 30{ 31 u64 data; 32 uint32_t thread; 33 34 data.u.i = 0x10000L; 35 thread = data.u.s.thread; 36 if (val) 37 abort (); 38 if (thread) 39 abort (); 40} 41 42int main(void) 43{ 44 foo (0); 45 return 0; 46} 47