gcc/libgomp
Tom de Vries 77e0a97acf [nvptx] Ignore c++ exceptions
The nvptx port can't support exceptions using sjlj, because ptx does not
support sjlj.  However, default_except_unwind_info still returns UI_SJLJ, even
even if we configure with --disable-sjlj-exceptions, because UI_SJLJ is the
fallback option.

The reason default_except_unwind_info doesn't return UI_DWARF2 is because
DWARF2_UNWIND_INFO is not defined in defaults.h, because
INCOMING_RETURN_ADDR_RTX is not defined, because there's no ptx equivalent.

Testcase libgomp.c++/for-15.C currently doesn't compile unless fno-exceptions
is added because:
- it tries to generate sjlj exception handling code, and
- it tries to generate exception tables using label-addressed .byte sequence.
  Ptx doesn't support generating random data at a label, nor being able to
  load/write data relative to a label.

This patch fixes the first problem by using UI_TARGET for nvptx.

The second problem is worked around by generating all .byte sequences commented
out.  It would be better to have a narrower workaround, and define
TARGET_ASM_BYTE_OP to "error: .byte unsupported " or some such.

This patch does not enable exceptions for nvptx, it merely allows c++ programs
to run correctly if they do no use exception handling.

Build and reg-tested on x86_64 with nvptx accelerator.

2018-08-02  Tom de Vries  <tdevries@suse.de>

	PR target/86660
	* common/config/nvptx/nvptx-common.c (nvptx_except_unwind_info): New
	function.  Return UI_TARGET unconditionally.
	(TARGET_EXCEPT_UNWIND_INFO): Redefine to nvptx_except_unwind_info.
	* config/nvptx/nvptx.c (TARGET_ASM_BYTE_OP): Emit commented out '.byte'.

	* testsuite/libgomp.oacc-c++/routine-1-auto.C: Remove -fno-exceptions.
	* testsuite/libgomp.oacc-c++/routine-1-template-auto.C: Same.
	* testsuite/libgomp.oacc-c++/routine-1-template-trailing-return-type.C:
	Same.
	* testsuite/libgomp.oacc-c++/routine-1-template.C: Same.
	* testsuite/libgomp.oacc-c++/routine-1-trailing-return-type.C: Same.
	* testsuite/libgomp.oacc-c-c++-common/routine-1.c: Same.

From-SVN: r263265
2018-08-02 15:59:01 +00:00
..
config [libgomp] Truncate config/nvptx/oacc-parallel.c 2018-08-01 13:01:45 -07:00
plugin [PATCH] Remove use of 'struct map' from plugin (nvptx) 2018-08-01 07:09:56 -07:00
testsuite [nvptx] Ignore c++ exceptions 2018-08-02 15:59:01 +00:00
acinclude.m4
aclocal.m4
affinity.c Update copyright years. 2018-01-03 11:03:58 +01:00
alloc.c Update copyright years. 2018-01-03 11:03:58 +01:00
atomic.c Update copyright years. 2018-01-03 11:03:58 +01:00
barrier.c Update copyright years. 2018-01-03 11:03:58 +01:00
ChangeLog [nvptx] Ignore c++ exceptions 2018-08-02 15:59:01 +00:00
ChangeLog.graphite
config.h.in
configure Regenerate configure of target libraries 2018-04-24 09:45:26 -07:00
configure.ac
configure.tgt
critical.c Update copyright years. 2018-01-03 11:03:58 +01:00
env.c [openacc] Move GOMP_OPENACC_DIM parsing out of nvptx plugin 2018-05-02 17:53:56 +00:00
error.c Update copyright years. 2018-01-03 11:03:58 +01:00
fortran.c Update copyright years. 2018-01-03 11:03:58 +01:00
hashtab.h Update copyright years. 2018-01-03 11:03:58 +01:00
icv-device.c Update copyright years. 2018-01-03 11:03:58 +01:00
icv.c Update copyright years. 2018-01-03 11:03:58 +01:00
iter_ull.c Update copyright years. 2018-01-03 11:03:58 +01:00
iter.c Update copyright years. 2018-01-03 11:03:58 +01:00
libgomp_f.h.in Update copyright years. 2018-01-03 11:03:58 +01:00
libgomp_g.h Update copyright years. 2018-01-03 11:03:58 +01:00
libgomp-plugin.c Update copyright years. 2018-01-03 11:03:58 +01:00
libgomp-plugin.h Update copyright years. 2018-01-03 11:03:58 +01:00
libgomp.h Update OpenACC data clause semantics to the 2.5 behavior 2018-06-20 09:35:15 -07:00
libgomp.map Update OpenACC data clause semantics to the 2.5 behavior 2018-06-20 09:35:15 -07:00
libgomp.spec.in
libgomp.texi libgomp.texi (Top): Move www.openmp.org to https. 2018-06-24 20:38:14 +00:00
lock.c Update copyright years. 2018-01-03 11:03:58 +01:00
loop_ull.c Update copyright years. 2018-01-03 11:03:58 +01:00
loop.c Update copyright years. 2018-01-03 11:03:58 +01:00
Makefile.am
Makefile.in re PR fortran/84381 (replace non-std 'call abort' by 'stop 1' in gfortran testsuite) 2018-03-25 16:00:52 +00:00
oacc-async.c [openacc] Factor out async argument utility functions 2018-05-09 13:52:49 +00:00
oacc-cuda.c [openacc] Factor out async argument utility functions 2018-05-09 13:52:49 +00:00
oacc-host.c Update copyright years. 2018-01-03 11:03:58 +01:00
oacc-init.c Update copyright years. 2018-01-03 11:03:58 +01:00
oacc-int.h [openacc] Factor out async argument utility functions 2018-05-09 13:52:49 +00:00
oacc-mem.c Update OpenACC data clause semantics to the 2.5 behavior 2018-06-20 09:35:15 -07:00
oacc-parallel.c Update OpenACC data clause semantics to the 2.5 behavior 2018-06-20 09:35:15 -07:00
oacc-plugin.c [openacc] Move GOMP_OPENACC_DIM parsing out of nvptx plugin 2018-05-02 17:53:56 +00:00
oacc-plugin.h [openacc] Move GOMP_OPENACC_DIM parsing out of nvptx plugin 2018-05-02 17:53:56 +00:00
omp_lib.f90.in Update copyright years. 2018-01-03 11:03:58 +01:00
omp_lib.h.in Update copyright years. 2018-01-03 11:03:58 +01:00
omp.h.in re PR libgomp/84096 (Wrong prototype for omp_init_nest_lock_with_hint() in "omp.h.in") 2018-01-30 00:38:01 +01:00
openacc_lib.h Update OpenACC data clause semantics to the 2.5 behavior 2018-06-20 09:35:15 -07:00
openacc.f90 Update OpenACC data clause semantics to the 2.5 behavior 2018-06-20 09:35:15 -07:00
openacc.h Update OpenACC data clause semantics to the 2.5 behavior 2018-06-20 09:35:15 -07:00
ordered.c Update copyright years. 2018-01-03 11:03:58 +01:00
parallel.c Update copyright years. 2018-01-03 11:03:58 +01:00
priority_queue.c Update copyright years. 2018-01-03 11:03:58 +01:00
priority_queue.h Update copyright years. 2018-01-03 11:03:58 +01:00
sections.c Update copyright years. 2018-01-03 11:03:58 +01:00
secure_getenv.h Update copyright years. 2018-01-03 11:03:58 +01:00
single.c Update copyright years. 2018-01-03 11:03:58 +01:00
splay-tree.c Update copyright years. 2018-01-03 11:03:58 +01:00
splay-tree.h Update copyright years. 2018-01-03 11:03:58 +01:00
target.c Update OpenACC data clause semantics to the 2.5 behavior 2018-06-20 09:35:15 -07:00
task.c Update copyright years. 2018-01-03 11:03:58 +01:00
taskloop.c Update copyright years. 2018-01-03 11:03:58 +01:00
team.c Update copyright years. 2018-01-03 11:03:58 +01:00
work.c Update copyright years. 2018-01-03 11:03:58 +01:00