]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge commit f75939599 from llvm git (by Erich Keane):
authordim <dim@FreeBSD.org>
Fri, 6 Mar 2020 17:02:14 +0000 (17:02 +0000)
committerdim <dim@FreeBSD.org>
Fri, 6 Mar 2020 17:02:14 +0000 (17:02 +0000)
commit146b3c67a3ba626d817528822187d611ee291817
treeee4d030855b993749b24de5bb457e68d4cc9ad57
parentcf07ed23e4b46907ab2f7ef0f0b7c829a100af6d
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
MFC after: 3 days
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