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

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 04:46:45 PST 2019


uweigand added a comment.

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.

> 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.

> 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.


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

https://reviews.llvm.org/D71441





More information about the llvm-commits mailing list