sccvn: Handle non-byte aligned offset or size for memset (, 123, ) [PR93945]
The following is the last spot in vn_reference_lookup_3 that didn't allow
non-byte aligned offsets or sizes. To be precise, it did allow size that
wasn't multiple of byte size and that caused a wrong-code issue on
big-endian, as the pr93945.c testcase shows, so for GCC 9 we should add
&& multiple_p (ref->size, BITS_PER_UNIT) check instead.
For the memset with SSA_NAME middle-argument, it still requires byte-aligned
offset, as we'd otherwise need to rotate the value at runtime.
2020-02-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/93582
PR tree-optimization/93945
* tree-ssa-sccvn.c (vn_reference_lookup_3): Handle memset with
non-zero INTEGER_CST second argument and ref->offset or ref->size
not a multiple of BITS_PER_UNIT.
* gcc.dg/tree-ssa/pr93582-9.c: New test.
* gcc.c-torture/execute/pr93945.c: New test.