[PATCH] D107497: [PowerPC][AIX] Limit attribute aligned to 4096.
Sean Fertile via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 5 06:51:54 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5181be344adb: [PowerPC][AIX] Limit attribute aligned to 4096. (authored by sfertile).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107497/new/
https://reviews.llvm.org/D107497
Files:
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/Sema/aix-attr-aligned-limit.c
Index: clang/test/Sema/aix-attr-aligned-limit.c
===================================================================
--- /dev/null
+++ clang/test/Sema/aix-attr-aligned-limit.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -triple powerpc-unknown-aix -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple powerpc64-unknown-aix -fsyntax-only -verify %s
+//
+int a __attribute__((aligned(8192))); // expected-error {{requested alignment must be 4096 bytes or smaller}}
Index: clang/lib/Sema/SemaDeclAttr.cpp
===================================================================
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -4054,6 +4054,9 @@
unsigned MaximumAlignment = Sema::MaximumAlignment;
if (Context.getTargetInfo().getTriple().isOSBinFormatCOFF())
MaximumAlignment = std::min(MaximumAlignment, 8192u);
+ else if (Context.getTargetInfo().getTriple().isOSAIX())
+ MaximumAlignment = std::min(MaximumAlignment, 4096u);
+
if (AlignVal > MaximumAlignment) {
Diag(AttrLoc, diag::err_attribute_aligned_too_great)
<< MaximumAlignment << E->getSourceRange();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107497.364450.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210805/a0d3a445/attachment.bin>
More information about the cfe-commits
mailing list