asf: Fix offset check in base reg initialization for big-endian targets
During the base register initialization, in the case that we are
eliminating the load instruction, we are using `offset == 0` in order
to find the store instruction that has the same offset as the
load. This would not work on big-endian targets where byte 0 would be
the MS byte.
This patch updates the condition to take into account the target's
endianness.
We are, also, removing the adjustment of the starting position for the
bitfield insertion, when BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN. This is
supposed to be handled inside `store_bit_field` and it's not needed
anymore after the offset fix.
Bootstrapped/regtested on AArch64 LE, x86_64 and PowerPC LE.
gcc/ChangeLog:
* avoid-store-forwarding.cc (generate_bit_insert_sequence):
Remove adjustment of bitfield insertion's starting position
when BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN.
(process_store_forwarding): Update offset check in base reg
initialization to take into account the target's endianness.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/avoid-store-forwarding-be.c: New test.