diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2016-11-02 16:03:13 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2016-11-02 16:03:13 +0000 |
commit | b231822daedfc5cf7dbacda8208daff722519776 (patch) | |
tree | 9dce5376893c59c036c46fc38bd5d39ff4d523b3 /gcc/gimple-ssa-store-merging.c | |
parent | 2b01aad6dc6a7328dab7f021b1291829d0a6f827 (diff) | |
download | gcc-b231822daedfc5cf7dbacda8208daff722519776.zip gcc-b231822daedfc5cf7dbacda8208daff722519776.tar.gz gcc-b231822daedfc5cf7dbacda8208daff722519776.tar.bz2 |
Fix for big-endian gcc.c-torture/execute/pr55750.c
* gimple-ssa-store-merging.c (encode_tree_to_bitpos): Don't forget to
clear padding bits even when they're less than a byte.
From-SVN: r241798
Diffstat (limited to 'gcc/gimple-ssa-store-merging.c')
-rw-r--r-- | gcc/gimple-ssa-store-merging.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c index 1bca4a1..36bc833 100644 --- a/gcc/gimple-ssa-store-merging.c +++ b/gcc/gimple-ssa-store-merging.c @@ -431,7 +431,8 @@ encode_tree_to_bitpos (tree expr, unsigned char *ptr, int bitlen, int bitpos, contain a sign bit due to sign-extension). */ unsigned int padding = byte_size - ROUND_UP (bitlen, BITS_PER_UNIT) / BITS_PER_UNIT - 1; - if (padding != 0) + if (padding != 0 + || bitlen % BITS_PER_UNIT != 0) { /* On big-endian the padding is at the 'front' so just skip the initial bytes. */ |