https://bugs.llvm.org/show_bug.cgi?id=42554

            Bug ID: 42554
           Summary: __BIGGEST_ALIGNMENT__ not the same as gcc for AVX and
                    later
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

When compiled -march=native (on znver1) with gcc and clang I get the following:

  * gcc 9.1.1 20190503 (Red Hat 9.1.1-1)

    alignof(max_align_t)=16  __BIGGEST_ALIGNMENT__=32  malloc() align=16
    __SSE__  __AVX__  __AVX2__

  * clang 8.0.0 (Fedora 8.0.0-1.fc30)
   (4.2.1 Compatible Clang 8.0.0 (Fedora 8.0.0-1.fc30))

   alignof(max_align_t)=16  __BIGGEST_ALIGNMENT__=16  malloc() align=16
   __SSE__  __AVX__  __AVX2__

When compiled without -march=native, both give:

   alignof(max_align_t)=16  __BIGGEST_ALIGNMENT__=16  malloc() align=16
   __SSE__

My guess is that clang's __BIGGEST_ALIGNMENT__ for -march=native is a bug...
except that gcc v4.2.1 predates AVX ???

FWIW: in all cases glibc malloc() aligned to 16.  My reading of the glibc code
tells me that its alignment is 2*sizeof(size_t), which is in fact the same as
alignof(max_align_t), but is in no way related.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to