diff options
author | Charles Baylis <charles.baylis@linaro.org> | 2016-01-27 15:38:45 +0000 |
---|---|---|
committer | Linaro Code Review <review@review.linaro.org> | 2016-02-04 14:39:53 +0000 |
commit | 5c396c068ea497f58494239b49c1122d123d8733 (patch) | |
tree | e1fbb5a3847903f8d6018bde1b424c3faa13c703 /gcc/testsuite | |
parent | a34627ef9d4fd6b541505a64fee177e27e3820cc (diff) |
gcc/
Backport from trunk r232154.
2016-01-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
PR tree-optimization/67781
* tree-ssa-math-opts.c (find_bswap_or_nop): Zero out bytes in cmpxchg
and cmpnop in two steps: first the ones not accessed in original
gimple expression in a endian independent way and then the ones not
accessed in the final result in an endian-specific way.
gcc/testsuite/
Backport from trunk r232154.
2016-01-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
PR tree-optimization/67781
* gcc.c-torture/execute/pr67781.c: New file.
Change-Id: I342f01fc0148d2209d46476301674d8be7ab5fad
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr67781.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr67781.c b/gcc/testsuite/gcc.c-torture/execute/pr67781.c new file mode 100644 index 00000000000..bf50aa2f6c3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr67781.c @@ -0,0 +1,34 @@ +#ifdef __UINT32_TYPE__ +typedef __UINT32_TYPE__ uint32_t; +#else +typedef unsigned uint32_t; +#endif + +#ifdef __UINT8_TYPE__ +typedef __UINT8_TYPE__ uint8_t; +#else +typedef unsigned char uint8_t; +#endif + +struct +{ + uint32_t a; + uint8_t b; +} s = { 0x123456, 0x78 }; + +int pr67781() +{ + uint32_t c = (s.a << 8) | s.b; + return c; +} + +int +main () +{ + if (sizeof (uint32_t) * __CHAR_BIT__ != 32) + return 0; + + if (pr67781 () != 0x12345678) + __builtin_abort (); + return 0; +} |