[PATCH] D71441: [Clang FE, SystemZ] Recognize -mpacked-stack CL option

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 10:34:49 PST 2019


jonpa added a comment.

In D71441#1785668 <https://reviews.llvm.org/D71441#1785668>, @uweigand wrote:

> The diag::err_opt_not_valid_on_target message is emitted from CodeGenFunction::StartFunction -- does that mean if you use -mpacked-stack on a non-SystemZ target when compiling a file with many functions, you get this error message many times?  If so, this should probably be moved somewhere else.  (It looks like the existing check for -mnop-mcount may already have the same problem.


No, it seems to only print this one time even in a file with multiple functions.

> 
> 
>> I found that all files look the same, except for all those who contain the __clang_call_terminate function, which gets the default stack layout even when -mpacked-stack is passed. This seems to relate to exceptions, and my guess is this doesn't need to be handled, but it probably could get the "packed-stack" attribute added somewhere in clang/lib/CodeGen if needed...
> 
> This function is synthesized in getClangCallTerminateFn and doesn't go through the usual StartFunction.   But I guess this doesn't really matter either way.

ok

> 
> 
>> Would we need to check in the backend that we don't have the attribute "packed-stack"="false", in case somebody would edit that by hand?
> 
> Hmm, some places look for an explicit attribute value of "true", e.g. the X86 target here:
> 
>   bool SoftFloat =
>       F.getFnAttribute("use-soft-float").getValueAsString() == "true";
>    
>    
> 
> I guess this would be preferable.

OK, I'll make a separate backend-patch for that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71441/new/

https://reviews.llvm.org/D71441





More information about the llvm-commits mailing list