HomePhabricator

[PowerPC] Fix va_arg in C++, Objective-C on 32-bit ELF targets

Authored by kernigh on Jan 22 2021, 9:13 PM.

Description

[PowerPC] Fix va_arg in C++, Objective-C on 32-bit ELF targets

In the PPC32 SVR4 ABI, a va_list has copies of registers from the function call.
va_arg looked in the wrong registers for (the pointer representation of) an
object in Objective-C, and for some types in C++. Fix va_arg to look in the
general-purpose registers, not the floating-point registers. Also fix va_arg
for some C++ types, like a member function pointer, that are aggregates for
the ABI.

Anthony Richardby found the problem in Objective-C. Eli Friedman suggested
part of this fix.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47921

Reviewed By: efriedma, nemanjai

Differential Revision: https://reviews.llvm.org/D90329

Details

Committed
bradJan 22 2021, 9:13 PM
Reviewer
efriedma
Differential Revision
D90329: [PowerPC] Fix va_arg in C++, Objective-C on 32-bit ELF targets
Parents
rG6c4356453036: [Coroutine] Improve coro-elide-musttail.ll test
Branches
Unknown
Tags
Unknown