[all-commits] [llvm/llvm-project] 018984: [PowerPC] Fix va_arg in C++, Objective-C on 32-bit...

George Koehler via All-commits all-commits at lists.llvm.org
Fri Jan 22 21:18:36 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 018984ae6833fae107aa9c502ab5536efceca88e
      https://github.com/llvm/llvm-project/commit/018984ae6833fae107aa9c502ab5536efceca88e
  Author: George Koehler <kernigh at gmail.com>
  Date:   2021-01-23 (Sat, 23 Jan 2021)

  Changed paths:
    M clang/lib/CodeGen/TargetInfo.cpp
    A clang/test/CodeGenCXX/ppc32-varargs-method.cpp
    A clang/test/CodeGenObjC/ppc32-varargs-id.m

  Log Message:
  -----------
  [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




More information about the All-commits mailing list