From e97c99f15937e5762a973b25192aab824126a6d3 Mon Sep 17 00:00:00 2001 From: Rong Xu Date: Tue, 2 Sep 2014 15:29:57 -0700 Subject: [gcc-4.9] Merge svn r214745 from google/gcc-4_9 branch. Merge gcc-4_9 source r214745 from google/gcc-4_9 branch. Change-Id: Ie6fa0fd72f4b4eec3adc4db4bb922e652d1c2605 --- .../gcc/testsuite/gcc.c-torture/execute/pr61375.c | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c') diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c new file mode 100644 index 000000000..6fb46939e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61375.c @@ -0,0 +1,35 @@ +#ifdef __UINT64_TYPE__ +typedef __UINT64_TYPE__ uint64_t; +#else +typedef unsigned long long uint64_t; +#endif + +#ifndef __SIZEOF_INT128__ +#define __int128 long long +#endif + +/* Some version of bswap optimization would ICE when analyzing a mask constant + too big for an HOST_WIDE_INT (PR61375). */ + +__attribute__ ((noinline, noclone)) uint64_t +uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2) +{ + __int128 mask = (__int128)0xffff << 56; + return ((in1 & mask) >> 56) | in2; +} + +int +main (int argc) +{ + __int128 in = 1; +#ifdef __SIZEOF_INT128__ + in <<= 64; +#endif + if (sizeof (uint64_t) * __CHAR_BIT__ != 64) + return 0; + if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128) + return 0; + if (uint128_central_bitsi_ior (in, 2) != 0x102) + __builtin_abort (); + return 0; +} -- cgit v1.2.3