<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - __BIGGEST_ALIGNMENT__ not the same as gcc for AVX and later"
   href="https://bugs.llvm.org/show_bug.cgi?id=42554">42554</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__BIGGEST_ALIGNMENT__ not the same as gcc for AVX and later
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>clang@gmch.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>