From 9f3c4c673d769bd3f1d504d85b743ba250e68d7b Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Fri, 27 Oct 2023 17:53:10 +0100 Subject: amdgcn: Fix bug in gfx1030 support patch The previous patch to add gfx1030 support introduced an issue with passing exit codes from kernels run under gcn-run (offload kernels were unaffected). gcc/ChangeLog: PR target/112088 * config/gcn/gcn.cc (gcn_expand_epilogue): Fix kernel epilogue register conflict. --- gcc/config/gcn/gcn.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gcc/config/gcn') diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc index 6f85f55..6a2aaef 100644 --- a/gcc/config/gcn/gcn.cc +++ b/gcc/config/gcn/gcn.cc @@ -3615,13 +3615,11 @@ gcn_expand_epilogue (void) set_mem_addr_space (retptr_mem, ADDR_SPACE_SCALAR_FLAT); emit_move_insn (kernarg_reg, retptr_mem); - rtx retval_addr = gen_rtx_REG (DImode, FIRST_VPARM_REG); + rtx retval_addr = gen_rtx_REG (DImode, FIRST_VPARM_REG + 2); emit_move_insn (retval_addr, kernarg_reg); rtx retval_mem = gen_rtx_MEM (SImode, retval_addr); - rtx scalar_retval = gen_rtx_REG (SImode, FIRST_VPARM_REG + 2); set_mem_addr_space (retval_mem, ADDR_SPACE_FLAT); - emit_move_insn (scalar_retval, gen_rtx_REG (SImode, RETURN_VALUE_REG)); - emit_move_insn (retval_mem, scalar_retval); + emit_move_insn (retval_mem, gen_rtx_REG (SImode, RETURN_VALUE_REG)); } emit_jump_insn (gen_gcn_return ()); -- cgit v1.1