[llvm-commits] [llvm-gcc-4.2] r108206 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Jim Grosbach grosbach at apple.com
Mon Jul 12 17:21:33 PDT 2010


On Jul 12, 2010, at 5:17 PM, Eric Christopher wrote:

> 
> On Jul 12, 2010, at 5:02 PM, Jim Grosbach wrote:
> 
>> The diagnostic needs to be a bit broader than this, actually. It's not just the variable sized allocation that can't be dynamically aligned, but any declaration in the same function. That is, a function which has variable sized stack objects cannot also contain stack objects which require dynamic stack realignment.
> 
> I'm not entirely convinced.  The original aim would have been to put the code in c-common.c so that when we handle user requested alignment we make the check on the stack size, but without including a lot of llvm bits into c-common.c it's not possible (unless we make the assumption that the gcc/config/arm backend has the right stack alignment :)
> 
> That said I should definitely add a quick check for DECL_USER_ALIGN to make sure that the user set it and not something else somewhere.
> 
> A quick change to say "requested alignment..." would probably help as well.
> 
> Unless I'm missing what you're trying to say (which is altogether possible).
> 

A function can either:
a) contain a variable sized stack-based object, or
b) require dynamic stack realignment.

If it tries to do both, an error diagnostic should be generated.

This is target, specific, also. It's true, as far as I know, for all targets currently, but that's not guaranteed to always be the case.

-Jim



More information about the llvm-commits mailing list