[PATCH] D87615: [X86] Fix stack alignment on 32-bit Solaris/x86
Rainer Orth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 15 01:42:50 PDT 2020
ro updated this revision to Diff 291831.
ro retitled this revision from "[clang][Driver] Force stack realignment on 32-bit Solaris/x86" to "[X86] Fix stack alignment on 32-bit Solaris/x86".
ro added a comment.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
Set `stackAlignment` instead.
Tested on `amd64-pc-solaris2.11`. However, compared to the `-mstackrealign` version
there's one regression that I still need to investigate:
UBSan-Standalone-i386 :: TestCases/TypeCheck/vptr.cpp
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87615/new/
https://reviews.llvm.org/D87615
Files:
llvm/lib/Target/X86/X86Subtarget.cpp
Index: llvm/lib/Target/X86/X86Subtarget.cpp
===================================================================
--- llvm/lib/Target/X86/X86Subtarget.cpp
+++ llvm/lib/Target/X86/X86Subtarget.cpp
@@ -258,13 +258,16 @@
report_fatal_error("64-bit code requested on a subtarget that doesn't "
"support it!");
- // Stack alignment is 16 bytes on Darwin, Linux, kFreeBSD and Solaris (both
- // 32 and 64 bit) and for all 64-bit targets.
+ // Stack alignment is 16 bytes on Darwin, Linux, kFreeBSD and for all
+ // 64-bit targets. On Solaris (32-bit), stack alignment is 4 bytes
+ // following the i386 psABI, while on Illumos it is always 16 bytes.
if (StackAlignOverride)
stackAlignment = *StackAlignOverride;
- else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() ||
- isTargetKFreeBSD() || In64BitMode)
+ else if (isTargetDarwin() || isTargetLinux() || isTargetKFreeBSD() ||
+ In64BitMode)
stackAlignment = Align(16);
+ else if (isTargetSolaris() && !In64BitMode)
+ stackAlignment = Align(4);
// Consume the vector width attribute or apply any target specific limit.
if (PreferVectorWidthOverride)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87615.291831.patch
Type: text/x-patch
Size: 1191 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200915/61f28db3/attachment.bin>
More information about the cfe-commits
mailing list