title: Different alignment of long doubles in a struct on 64 bit linux with gcc and clang
body: <p>I noticed that gcc and clang compile the following code differently:</p>
  <pre><code>struct { long double ld[1]; } ld1;
  struct { long double ld[2]; } ld2;
  struct { long double ld[3]; } ld3;
  </code></pre>
  <p>gcc</p>
  <pre><code>.comm   ld1,16,16
  .comm   ld2,32,32
  .comm   ld3,48,32
  </code></pre>
  <p>clang</p>
  <pre><code>.type   ld1,@object             # @ld1
  .comm   ld1,16,16
  .type   ld2,@object             # @ld2
  .comm   ld2,32,16
  .type   ld3,@object             # @ld3
  .comm   ld3,48,16
  </code></pre>
  <p>According to the <a href="https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf" rel="nofollow noreferrer">x86_64 ABI</a>, the alignment should be 16. Why is gcc aligning the latter two structs on 32?</p>
  <p>I am using gcc <code>Ubuntu 9.3.0-17ubuntu1~20.04 9.3.0</code> and clang <code>10.0.0-4ubuntu1</code> on Ubuntu <code>20.04.1 LTS</code>.</p>