Hi all,

I noticed that my patch for PR tree-optimization/78170 broke 
execute.exp=pr55750.c on big-endian.
The problem with that patch is that we should not forget to clear the padding 
bits in the temporary
buffer when merging values even when they are less than a byte.

Tested on aarch64_be-none-elf (the test failure goes away)
Bootstrap and test on x86_64 ongoing.
Ok for trunk if successful?

David, does this patch allow AIX bootstrap to proceed by any chance?

Thanks,
Kyrill

2016-11-02  Kyrylo Tkachov  <kyrylo.tkac...@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.
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c
index 081620e50f603e2de8ed962aec6c619890ce1e33..db3c3c14a5b8938024db8bed80145c77d29396ac 100644
--- a/gcc/gimple-ssa-store-merging.c
+++ b/gcc/gimple-ssa-store-merging.c
@@ -430,7 +430,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.  */

Reply via email to