Compare commits

...

3 Commits

Author SHA1 Message Date
Hans Wennborg
12f174e98c Merging r371969:
------------------------------------------------------------------------
r371969 | karka | 2019-09-16 11:52:23 +0200 (Mon, 16 Sep 2019) | 13 lines

Change signature of __builtin_rotateright64 back to unsigned

The signature of __builtin_rotateright64 was by misstake changed from
unsigned to signed in r360863, this patch will change it back to
unsigned as intended.

This fixes pr43309

Reviewers: efriedma, hans

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D67606
------------------------------------------------------------------------

llvm-svn: 372100
2019-09-17 10:19:31 +00:00
Hans Wennborg
8972a4776d ReleaseNotes: known issue: PR40547
llvm-svn: 371964
2019-09-16 09:11:39 +00:00
Hans Wennborg
02a0ef03e6 Merging r371766:
------------------------------------------------------------------------
r371766 | nickdesaulniers | 2019-09-12 21:53:35 +0200 (Thu, 12 Sep 2019) | 29 lines

[Clang][CodeGen] support alias attribute w/ gnu_inline

Summary:
r369705 did not consider the addition of gnu_inline on function
declarations of alias attributed functions. This resulted in a reported
regression in the clang-9-rc4 release from the Zig developers building
glibc, which was observable as a failed assertion:

llvm-project/clang/lib/AST/Decl.cpp:3336: bool
clang::FunctionDecl::isInlineDefinitionExternallyVisible() const:
Assertion `(doesThisDeclarationHaveABody() || willHaveBody()) && "Must
be a function definition"' failed.

Alias function declarations do not have bodies, so allow us to proceed
if we have the alias function attribute but no body/definition, and add
a test case.  The emitted symbols and their linkage matches GCC for the
added test case.

Link: https://bugs.llvm.org/show_bug.cgi?id=43268

Reviewers: aaron.ballman, rsmith, erichkeane, andrewrk

Reviewed By: andrewrk

Subscribers: cfe-commits, andrewrk, hans, srhines

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67455
------------------------------------------------------------------------

llvm-svn: 371821
2019-09-13 08:10:33 +00:00
5 changed files with 21 additions and 2 deletions

View File

@@ -440,7 +440,7 @@ BUILTIN(__builtin_rotateleft64, "UWiUWiUWi", "nc")
BUILTIN(__builtin_rotateright8, "UcUcUc", "nc")
BUILTIN(__builtin_rotateright16, "UsUsUs", "nc")
BUILTIN(__builtin_rotateright32, "UZiUZiUZi", "nc")
BUILTIN(__builtin_rotateright64, "UWiUWiWi", "nc")
BUILTIN(__builtin_rotateright64, "UWiUWiUWi", "nc")
// Random GCC builtins
BUILTIN(__builtin_constant_p, "i.", "nctu")

View File

@@ -3332,7 +3332,8 @@ SourceRange FunctionDecl::getExceptionSpecSourceRange() const {
/// an externally visible symbol, but "extern inline" will not create an
/// externally visible symbol.
bool FunctionDecl::isInlineDefinitionExternallyVisible() const {
assert((doesThisDeclarationHaveABody() || willHaveBody()) &&
assert((doesThisDeclarationHaveABody() || willHaveBody() ||
hasAttr<AliasAttr>()) &&
"Must be a function definition");
assert(isInlined() && "Function must be inline");
ASTContext &Context = getASTContext();

View File

@@ -99,3 +99,8 @@ static int test10_foo __attribute__((alias("test10")));
// CHECKGLOBALS-NOT: @test11_foo = dso_local
void test11(void) {}
static void test11_foo(void) __attribute__((alias("test11")));
// Test that gnu_inline+alias work.
// CHECKGLOBALS: @test12_alias = alias void (), void ()* @test12
void test12(void) {}
inline void test12_alias(void) __attribute__((gnu_inline, alias("test12")));

View File

@@ -1,5 +1,9 @@
// RUN: %clang_cc1 -triple avr-unknown-unknown -emit-llvm -o - %s | FileCheck %s
// Check that the parameter types match. This verifies pr43309.
// RUN: %clang_cc1 -triple avr-unknown-unknown -Wconversion -verify %s
// expected-no-diagnostics
unsigned char bitrev8(unsigned char data) {
return __builtin_bitreverse8(data);
}

View File

@@ -21,6 +21,15 @@ have questions or comments, the `LLVM Developer's Mailing List
them.
Known Issues
============
These are issues that couldn't be fixed before the release. See the bug reports
for the latest status.
* `PR40547 <https://llvm.org/pr40547>`_ Clang gets miscompiled by GCC 9.
Non-comprehensive list of changes in this release
=================================================