[clang][RISCV] Fix ABI mismatch between GCC and Clang (extension of integers on stack)
authorAlex Bradbury <asb@igalia.com>
Tue, 24 Jan 2023 14:18:09 +0000 (14:18 +0000)
committerAlex Bradbury <asb@igalia.com>
Tue, 24 Jan 2023 14:20:28 +0000 (14:20 +0000)
commite0a28188d2b53427bc90cdf7f7899c64af102489
treecf19b98336e28ccb7c271c4ae739e80785626c1f
parent13a85a78cfea78af908300b3e8993b57da83921f
[clang][RISCV] Fix ABI mismatch between GCC and Clang (extension of integers on stack)

See <https://github.com/llvm/llvm-project/issues/57261> for full
details. Essentially, a previous version of the psABI indicated (by my
reading) that integer scalars passed on the stack were anyext. A [later
commit](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/cec39a064ee0e5b0129973fffab7e3ad1710498f)
changed this to indicate that they are in fact signext/zeroext just as
if they were passed in registers.

This patch adds the change in the release notes but doesn't add a flag
to retain the old behaviour. The hope is that it's sufficiently hard to
trigger an issue due to this that it isn't worthwhile doing so.

Differential Revision: https://reviews.llvm.org/D140401
clang/docs/ReleaseNotes.rst
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGen/RISCV/riscv32-ilp32-abi.c
clang/test/CodeGen/RISCV/riscv32-ilp32-ilp32f-abi.c
clang/test/CodeGen/RISCV/riscv32-ilp32-ilp32f-ilp32d-abi.c
clang/test/CodeGen/RISCV/riscv32-ilp32f-abi.c
clang/test/CodeGen/RISCV/riscv64-lp64-abi.c
clang/test/CodeGen/RISCV/riscv64-lp64-lp64f-abi.c
clang/test/CodeGen/RISCV/riscv64-lp64-lp64f-lp64d-abi.c