https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78853
Bug ID: 78853
Summary: aligned reads/writes (vmovdqa) emitted when no such
guarantee can be made
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: gonnet at google dot com
Target Milestone: ---
I have an example on https://godbolt.org/g/qZ4SuT, this produces incorrect code
since at least gcc-4.9.1 (didn't test earlier).
I have a function that swaps to pieces of memory using vectorized read/write
instructions. When I pass it a 28-byte struct that has been padded to 32 bytes,
it emits two vmovdqa reads and writes.
The problem is that it does this even when it can't guarantee that the pointers
provided to it are aligned correctly.