RISC-V: Don't clobber retval when __builtin_eh_return called.
commit36efd2a73f18fed3c6195411169cf5f82c6dece2
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Jun 2018 23:44:43 +0000 (4 23:44 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Jun 2018 23:44:43 +0000 (4 23:44 +0000)
tree03263010be208d5849160a44dc4bb222b68e0daa
parentf9ceb30223aaebae54f94dc80ab77c91aefd5440
RISC-V: Don't clobber retval when __builtin_eh_return called.

gcc/
* config/riscv/riscv-protos.h (riscv_expand_epilogue): Change bool arg
to int.
* config/riscv/riscv.c (riscv_for_each_saved_reg): New args epilogue
and maybe_eh_return.  Change regno to unsigned int.  Use new args to
handle EH_RETURN_DATA_REGNO registers properly.
(riscv_expand_prologue): Pass new args to riscv_for_each_saved_reg.
(riscv_expand_epilogue): Update comment.  Change argument name and
type.  Update code to use new name and type.  Pass new args to
riscv_for_each_saved_reg.  Only use EH_RETURN_STACKADJ_RTX when
EXCEPTION_RETURN.
* config/riscv/riscv.md (NORMAL_RETURN): New.
(SIBCALL_RETURN, EXCEPTION_RETURN): New.
(epilogue, sibcall_epilogue): Update riscv_expand_epilogue arg.
(eh_return): Call gen_eh_return_internal and emit barrier.
(eh_return_internal): Call riscv_expand_epilogue.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261176 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv.c
gcc/config/riscv/riscv.md