+2015-12-07 Nathan Sidwell <nathan@acm.org>
+
+ * config/nvptx/nvptx.c (nvptx_output_call_insn): Emit trap after no
+ return call.
+
2015-12-07 David Malcolm <dmalcolm@redhat.com>
* pretty-print.c (text_info::set_range): Rename to...
}
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");
+
return result != NULL_RTX ? "\tld.param%t0\t%0, [%%retval_in];\n\t}" : "}";
}
+2015-12-07 Nathan Sidwell <nathan@acm.org>
+
+ * gcc.target/nvptx/abort.c: New.
+
2015-12-07 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/diagnostic-ranges-1.c: New test file.
--- /dev/null
+/* { dg-do compile} */
+/* Annotate no return functions with a trailing 'trap'. */
+
+extern void abort ();
+
+int main (int argc, char **argv)
+{
+ if (argc > 2)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "call abort;\[\r\n\t \]+trap;" } } */