[PATCH] D105067: [SystemZ] Emit .gnu_attribute for an externally visible vector abi.

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 6 05:04:05 PDT 2021


uweigand added a comment.

In D105067#2857971 <https://reviews.llvm.org/D105067#2857971>, @jonpa wrote:

>> I don't think this implementation of vararg support is quite complete. On the caller side, you check for variable arguments to any direct function with a prototype. However, this misses the case where an *indirect* function call (using a function pointer) has variable arguments.
>>
>> This also completely misses the *callee* side: every function that takes variable arguments and uses va_arg with a vector type is also dependent on the vector ABI.
>
> Patch updated to address these cases as well.

Unfortunately I think this still catches only a subset of those cases.   For the indirect calls, you now check those using a global function pointer variable.  But calls via a local function pointer (e.g. a callback argument) have the same problem.   For the callee side, you now check exported functions that use va_start - but we also need to handle functions that get a va_list as argument, as well as non-exported functions (you can pass va_list through to other routines).

GCC checks every call instruction in the whole compilation unit that uses variable argument lists, and it also checks every use of va_arg.  I believe we may have to do the same.  (This is a problem since va_arg is already expanded by the front-end.   I'm starting to think this whole logic might be better placed in clang; we can just set a flag there when we expand a call or a va_arg, and don't have to scan everything after the fact ...)


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

https://reviews.llvm.org/D105067



More information about the llvm-commits mailing list