[Bug target/78853] aligned reads/writes (vmovdqa) emitted when no such guarantee can be made

2016-12-19 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78853

--- Comment #4 from Markus Trippelsdorf  ---
See: http://refspecs.linuxfoundation.org/elf/x86-64-abi-0.99.pdf

[Bug target/78853] aligned reads/writes (vmovdqa) emitted when no such guarantee can be made

2016-12-19 Thread gonnet at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78853

--- Comment #3 from Pedro Gonnet  ---
OK, thanks for clarifying!

The declaration of __m256i only specifies the attributes vector_size and
may_alias
(https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/i386/avxintrin.h;hb=HEAD#l56),
so I'm guessing vector_size implies alignment? This does not seem to be
documented anywhere obvious.

Also interesting is that icc-17 produces unaligned load/stores for the same
code, but there is no amount of __attribute__((aligned(32))) that will make
them aligned.

In any case I'll use the __m*_u types to make an unaligned version of my
memswap function.

[Bug target/78853] aligned reads/writes (vmovdqa) emitted when no such guarantee can be made

2016-12-19 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78853

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||trippels at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #2 from Markus Trippelsdorf  ---
Please run your code with -fsanitize=undefined before opening bugs in the
future.
See PR65709 for an explanation.

[Bug target/78853] aligned reads/writes (vmovdqa) emitted when no such guarantee can be made

2016-12-18 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78853

--- Comment #1 from Andrew Pinski  ---
IIRC __m512i, __m256i, and __m128i all have alignment requirements which is why
you are getting this code.

I think your code does not check for alignment which is broken.