svn commit: r242835 - head/contrib/llvm/lib/Target/X86

Nathan Whitehorn nwhitehorn at freebsd.org
Sun Nov 11 04:33:51 UTC 2012


On 11/09/12 12:56, Dimitry Andric wrote:
> Author: dim
> Date: Fri Nov  9 18:56:27 2012
> New Revision: 242835
> URL: http://svnweb.freebsd.org/changeset/base/242835
>
> Log:
>    Reduce LLVM's default stack alignment for i386 from 16 to 4 bytes, as
>    the FreeBSD ABI requires.  This is essentially a revert of upstream llvm
>    commit r126226, and it will be reverted by upstream too.
>    
>    MFC after:	1 week
>
> Modified:
>    head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp
>
> Modified: head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp
> ==============================================================================
> --- head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp	Fri Nov  9 18:23:38 2012	(r242834)
> +++ head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp	Fri Nov  9 18:56:27 2012	(r242835)
> @@ -416,12 +416,12 @@ X86Subtarget::X86Subtarget(const std::st
>     assert((!In64BitMode || HasX86_64) &&
>            "64-bit code requested on a subtarget that doesn't support it!");
>   
> -  // Stack alignment is 16 bytes on Darwin, FreeBSD, Linux and Solaris (both
> -  // 32 and 64 bit) and for all 64-bit targets.
> +  // Stack alignment is 16 bytes on Darwin, Linux and Solaris (both 32 and 64
> +  // bit) and for all 64-bit targets.
>     if (StackAlignOverride)
>       stackAlignment = StackAlignOverride;
> -  else if (isTargetDarwin() || isTargetFreeBSD() || isTargetLinux() ||
> -           isTargetSolaris() || In64BitMode)
> +  else if (isTargetDarwin() || isTargetLinux() || isTargetSolaris() ||
> +           In64BitMode)
>       stackAlignment = 16;
>   }
>   

I'd like to object to this. We have an identical ABI to Linux (and 
Solaris, as far as I know). Splitting this by platform will only 
propagate the stack alignment breakage further -- what we need is 
LLVM/our C library to handle different alignments. Please fix this for 
real instead of balkanizing the ABI support in LLVM and introducing 
different ABIs for LLVM and GCC to FreeBSD.
-Nathan


More information about the svn-src-all mailing list