aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/nvptx
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2017-09-25 10:36:23 +0000
committerTom de Vries <vries@gcc.gnu.org>2017-09-25 10:36:23 +0000
commitfb202364391854f7c16eee74c270b0d78ad8f532 (patch)
tree4a717c30abf2cbc874b004311e433244b4ae325c /gcc/config/nvptx
parent851e9f19e27e1f840f9a978fc7103397043d8826 (diff)
downloadgcc-fb202364391854f7c16eee74c270b0d78ad8f532.zip
gcc-fb202364391854f7c16eee74c270b0d78ad8f532.tar.gz
gcc-fb202364391854f7c16eee74c270b0d78ad8f532.tar.bz2
[nvptx] Add exit after call to noreturn function
2017-09-25 Tom de Vries <tom@codesourcery.com> PR target/80035 PR target/81069 * config/nvptx/nvptx.c (nvptx_output_call_insn): Add exit after call to noreturn function. From-SVN: r253145
Diffstat (limited to 'gcc/config/nvptx')
-rw-r--r--gcc/config/nvptx/nvptx.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 6cf9a66..634f660 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)
{