From: Tom de Vries Date: Mon, 25 Sep 2017 10:36:23 +0000 (+0000) Subject: [nvptx] Add exit after call to noreturn function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb202364391854f7c16eee74c270b0d78ad8f532;p=gcc.git [nvptx] Add exit after call to noreturn function 2017-09-25 Tom de Vries PR target/80035 PR target/81069 * config/nvptx/nvptx.c (nvptx_output_call_insn): Add exit after call to noreturn function. From-SVN: r253145 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4967e988a63..8b379b751cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-09-25 Tom de Vries + + PR target/80035 + PR target/81069 + * config/nvptx/nvptx.c (nvptx_output_call_insn): Add exit after call to + noreturn function. + 2017-09-25 Richard Biener * graphite-optimize-isl.c (optimize_isl): Fail and dump if diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 6cf9a662763..634f66038fa 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -2304,11 +2304,14 @@ nvptx_output_call_insn (rtx_insn *insn, rtx result, rtx callee) fprintf (asm_out_file, ";\n"); if (find_reg_note (insn, REG_NORETURN, NULL)) - /* No return functions confuse the PTX JIT, as it doesn't realize - the flow control barrier they imply. It can seg fault if it - encounters what looks like an unexitable loop. Emit a trailing - trap, which it does grok. */ - fprintf (asm_out_file, "\t\ttrap; // (noreturn)\n"); + { + /* No return functions confuse the PTX JIT, as it doesn't realize + the flow control barrier they imply. It can seg fault if it + encounters what looks like an unexitable loop. Emit a trailing + trap and exit, which it does grok. */ + fprintf (asm_out_file, "\t\ttrap; // (noreturn)\n"); + fprintf (asm_out_file, "\t\texit; // (noreturn)\n"); + } if (result) {