[PATCH] D107497: [PowerPC][AIX] Limit attribute aligned to 4096.
sfertile created this revision. sfertile added reviewers: Jake-Egan, stevewan. sfertile added a project: PowerPC. Herald added subscribers: shchenz, nemanjai. Herald added a reviewer: aaron.ballman. sfertile requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Limit the maximum alignment for attribute aligned to 4096 to match the limit of the .align pseudo op in the system assembler. Repository: rG LLVM Github Monorepo 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(); 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(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D107497: [PowerPC][AIX] Limit attribute aligned to 4096.
sfertile updated this revision to Diff 364264. sfertile added a comment. Fix formatting. 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(); 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(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D107497: [PowerPC][AIX] Limit attribute aligned to 4096.
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107497/new/ https://reviews.llvm.org/D107497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D107497: [PowerPC][AIX] Limit attribute aligned to 4096.
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(); 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(); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits