[all-commits] [llvm/llvm-project] d1a96e: [clang][emscripten] Reduce alignof long double fro...

Sam Clegg via All-commits all-commits at lists.llvm.org
Fri Jul 2 11:06:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d1a96e906cc03a95cfd41a1f22bdda92651250c7
      https://github.com/llvm/llvm-project/commit/d1a96e906cc03a95cfd41a1f22bdda92651250c7
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2021-07-02 (Fri, 02 Jul 2021)

  Changed paths:
    M clang/lib/Basic/Targets/OSTargets.h

  Log Message:
  -----------
  [clang][emscripten] Reduce alignof long double from 16 to 8 bytes

This means `max_align_t` is 8 bytes which also sets the alignment
malloc.  Since this is technically and ABI breaking change we have
limited to just the emscripten OS target.  It is also relatively low
import breakage since it will only effect the alignement of struct that
contai `long double`s (extremerly rare I imagine).

Emscripten's malloc implementation already use 8 byte alignement
(dlmalloc uses and alignement of 2*sizeof(void*) == 8 rather than
checking max_align_t) so will not be effected by this change.  By
bringing the ABI in line with the current malloc code this will fix
several issue we have seen in the wild.

See: https://github.com/emscripten-core/emscripten/pull/14456

Differential Revision: https://reviews.llvm.org/D104808




More information about the All-commits mailing list