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

            Bug ID: 124929
           Summary: alignof(__m512) varies depending on target attribute
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blubban at gmail dot com
  Target Milestone: ---

#include <immintrin.h>

int a()
{
    return alignof(__m512);
}

__attribute__((target("avx")))
int b()
{
    return alignof(__m512);
}

__attribute__((target("avx512f")))
int c()
{
    return alignof(__m512);
}


No flags needed.

Expected: 64 for all, of course.

Actual: 16, 32 and 64, respectively. https://godbolt.org/z/641jvEqPz

Similar happens with __m256 and __m{256,512}{i,d}.

Likely related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97222, but since
no templates or name mangling is involved (it even reproduces with -xc), I
don't think it's a duplicate.

Reply via email to