aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2016-11-02 16:03:13 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2016-11-02 16:03:13 +0000
commitb231822daedfc5cf7dbacda8208daff722519776 (patch)
tree9dce5376893c59c036c46fc38bd5d39ff4d523b3
parent2b01aad6dc6a7328dab7f021b1291829d0a6f827 (diff)
downloadgcc-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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gimple-ssa-store-merging.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 241ff78d..96bcf41 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-11-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gimple-ssa-store-merging.c (encode_tree_to_bitpos): Don't forget to
+ clear padding bits even when they're less than a byte.
+
2016-11-02 Richard Biener <rguenther@suse.de>
* gimple-ssa-store-merging.c: Include gimplify-me.h.
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. */