]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r358711:
authorDimitry Andric <dim@FreeBSD.org>
Mon, 9 Mar 2020 07:12:02 +0000 (07:12 +0000)
committerDimitry Andric <dim@FreeBSD.org>
Mon, 9 Mar 2020 07:12:02 +0000 (07:12 +0000)
commit78db4f3ab417ec0f4319ed9f3967404624e5d0b1
treef6af7642132c29c1d4b0bdee36621e499d86aea2
parent90a0048afcf0863abd74f4a57a7fbf1f52069be2
MFC r358711:

Merge commit f75939599 from llvm git (by Erich Keane):

  Reland r374450 with Richard Smith's comments and test fixed.

  The behavior from the original patch has changed, since we're no
  longer allowing LLVM to just ignore the alignment.  Instead, we're
  just assuming the maximum possible alignment.

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

  llvm-svn: 374562

This fixes 'Assertion failed: (Alignment != 0 && "Invalid Alignment"),
function CreateAlignmentAssumption', when building recent versions of
v8, which invoke __builtin_assume_aligned() with its alignment argument
set to 4GiB or more.

Clang will now report a warning, and show the maximum possible alignment
instead, e.g.:

huge-align.cpp:1:27: warning: requested alignment must be 536870912 bytes or smaller; maximum alignment assumed [-Wbuiltin-assume-aligned-alignment]
void *f(void *g) { return __builtin_assume_aligned(g, 4294967296); }
                          ^                           ~~~~~~~~~~

Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=43839
Reported by: cem
contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td
contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp
contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp
contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp
contrib/llvm-project/clang/lib/CodeGen/CGStmtOpenMP.cpp
contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp
contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.h
contrib/llvm-project/clang/lib/Sema/SemaChecking.cpp