[Bug c++/98317] New: Vector Extensions aligned(1) not generating unaligned loads/stores

danielhanchen at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Dec 16 11:30:35 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98317

            Bug ID: 98317
           Summary: Vector Extensions aligned(1) not generating unaligned
                    loads/stores
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danielhanchen at gmail dot com
  Target Milestone: ---

The ordering of aligned(1) causes GCC to generate movaps / movups.

typedef float   float128_tv1    __attribute__ ((aligned(1), vector_size(16)));
typedef float   float128_tv2    __attribute__ ((vector_size(16), aligned(1)));

float128_tv1 provides MOVAPS
float128_tv2 provides MOVUPS

It seems like the ordering of the arguments changes the assembly.

https://gcc.godbolt.org/z/5qs7e7

It seems like GCC 10.2 and 9.2 all have this issue.
Unless if this was already documentated, this issue can cause massive issues if
memory is unaligned and an aligned load/store is used instead.


More information about the Gcc-bugs mailing list