From 210f0882c9e5d6f504b8f29e8a5eae884f812e5c Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 23 Jan 2020 23:10:02 +0300 Subject: [PATCH] Revert "[Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`" Likely makes bots angry. This reverts commit a4cfb15d15a8a353fe316f2a9fe1c8c6a6740ef1. # Conflicts: # clang/lib/Sema/SemaDeclAttr.cpp --- clang/lib/Sema/SemaDeclAttr.cpp | 4 ---- clang/test/Sema/builtin-assume-aligned.c | 1 - 2 files changed, 5 deletions(-) diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 54a65f5f26ae..b404b45fec59 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1625,10 +1625,6 @@ void Sema::AddAssumeAlignedAttr(Decl *D, const AttributeCommonInfo &CI, Expr *E, << E->getSourceRange(); return; } - - if (I > Sema::MaximumAlignment) - Diag(CI.getLoc(), diag::warn_assume_aligned_too_great) - << CI.getRange() << Sema::MaximumAlignment; } if (OE) { diff --git a/clang/test/Sema/builtin-assume-aligned.c b/clang/test/Sema/builtin-assume-aligned.c index b862f865c2ca..565dc6609442 100644 --- a/clang/test/Sema/builtin-assume-aligned.c +++ b/clang/test/Sema/builtin-assume-aligned.c @@ -46,7 +46,6 @@ int test8(int *a, int j) { void test_void_assume_aligned(void) __attribute__((assume_aligned(32))); // expected-warning {{'assume_aligned' attribute only applies to return values that are pointers}} int test_int_assume_aligned(void) __attribute__((assume_aligned(16))); // expected-warning {{'assume_aligned' attribute only applies to return values that are pointers}} void *test_ptr_assume_aligned(void) __attribute__((assume_aligned(64))); // no-warning -void *test_ptr_assume_aligned(void) __attribute__((assume_aligned(1073741824))); // expected-warning {{requested alignment must be 536870912 bytes or smaller; maximum alignment assumed}} int j __attribute__((assume_aligned(8))); // expected-warning {{'assume_aligned' attribute only applies to Objective-C methods and functions}} void *test_no_fn_proto() __attribute__((assume_aligned(32))); // no-warning