]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Promote type correctly for libcalls
authorKito Cheng <kito.cheng@sifive.com>
Mon, 5 Aug 2019 07:54:31 +0000 (07:54 +0000)
committerKito Cheng <kito@gcc.gnu.org>
Mon, 5 Aug 2019 07:54:31 +0000 (07:54 +0000)
commit41e094840be3fc6dc92875aa41c25f8077a1f8e3
tree20f097024008ced5dd37e887a77bb11a8995e9da
parent2aeeb52fc4890c878d15202d98195a0155fc8105
RISC-V: Promote type correctly for libcalls

 - argument and return value for libcall won't promote at
   default_promote_function_mode_always_promote, however we expect it
   should sign-extend as normal function.

 - Witout this patch, this test case will fail at -march=rv64i -mabi=lp64.

 - The implementation of riscv_promote_function_mode is borrowed from MIPS.

gcc/ChangeLog

Backport from mainline
2019-08-05  Kito Cheng  <kito.cheng@sifive.com>

* config/riscv/riscv.c (riscv_promote_function_mode): New.
(TARGET_PROMOTE_FUNCTION_MODE): Use riscv_promote_function_mode.

gcc/testsuite/ChangeLog

Backport from mainline
2019-08-05  Kito Cheng  <kito.cheng@sifive.com>

* gcc.target/riscv/promote-type-for-libcall.c: New.

From-SVN: r274108
gcc/ChangeLog
gcc/config/riscv/riscv.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/riscv/promote-type-for-libcall.c [new file with mode: 0644]