gcc/libgomp
Jakub Jelinek 0d973c0a0d openmp: Implement the error directive
This patch implements the error directive.  Depending on clauses it is either
a compile time diagnostics (in that case diagnosed right away) or runtime
diagnostics (libgomp API call that diagnoses at runtime), and either fatal
or warning (error or warning at compile time or fatal error vs. error at
runtime) and either has no message or user supplied message (this kind of
e.g. deprecated attribute).  The directive is also stand-alone directive
when at runtime while utility (thus disappears from the IL as if it wasn't
there for parsing like nothing directive) at compile time.

There are some clarifications in the works ATM, so this patch doesn't yet
require that for compile time diagnostics the user message must be a constant
string literal, there are uncertainities on what exactly is valid argument
of message clause (whether just const char * type, convertible to const char *,
qualified/unqualified const char * or char * or what else) and what to do
in templates.  Currently even in templates it is diagnosed right away for
compile time diagnostics, if we'll need to substitute it, we'd need to queue
something into the IL, have pt.c handle it and diagnose only later.

2021-08-20  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* omp-builtins.def (BUILT_IN_GOMP_WARNING, BUILT_IN_GOMP_ERROR): New
	builtins.
gcc/c-family/
	* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ERROR.
	* c-pragma.c (omp_pragmas): Add error directive.
	* c-omp.c (omp_directives): Uncomment error directive entry.
gcc/c/
	* c-parser.c (c_parser_omp_error): New function.
	(c_parser_pragma): Handle PRAGMA_OMP_ERROR.
gcc/cp/
	* parser.c (cp_parser_handle_statement_omp_attributes): Determine if
	PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
	(cp_parser_omp_error): New function.
	(cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
gcc/fortran/
	* types.def (BT_FN_VOID_CONST_PTR_SIZE): New DEF_FUNCTION_TYPE_2.
	* f95-lang.c (ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST): Define.
gcc/testsuite/
	* c-c++-common/gomp/error-1.c: New test.
	* c-c++-common/gomp/error-2.c: New test.
	* c-c++-common/gomp/error-3.c: New test.
	* g++.dg/gomp/attrs-1.C (bar): Add error directive test.
	* g++.dg/gomp/attrs-2.C (bar): Add error directive test.
	* g++.dg/gomp/attrs-13.C: New test.
	* g++.dg/gomp/error-1.C: New test.
libgomp/
	* libgomp.map (GOMP_5.1): Add GOMP_error and GOMP_warning.
	* libgomp_g.h (GOMP_warning, GOMP_error): Declare.
	* error.c (GOMP_warning, GOMP_error): New functions.
	* testsuite/libgomp.c-c++-common/error-1.c: New test.
2021-08-20 11:36:52 +02:00
..
config openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
plugin amdgcn: Enable OpenACC worker partitioning for AMD GCN 2021-08-09 15:08:44 +02:00
testsuite openmp: Implement the error directive 2021-08-20 11:36:52 +02:00
.gitattributes libgomp: Fixes + cleanup for OpenACC's Fortran module + openacc_lib.h 2020-02-19 09:13:44 +01:00
ChangeLog Daily bump. 2021-08-19 00:16:42 +00:00
ChangeLog.graphite
Makefile.am openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
Makefile.in openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
acc_prof.h Update copyright years. 2021-01-04 10:26:59 +01:00
acinclude.m4 re PR other/79543 (Inappropriate "ld --version" checking) 2019-09-03 14:10:26 +00:00
aclocal.m4 libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00
affinity-fmt.c Update copyright years. 2021-01-04 10:26:59 +01:00
affinity.c Update copyright years. 2021-01-04 10:26:59 +01:00
alloc.c Update copyright years. 2021-01-04 10:26:59 +01:00
allocator.c Update copyright years. 2021-01-04 10:26:59 +01:00
atomic.c Update copyright years. 2021-01-04 10:26:59 +01:00
barrier.c Update copyright years. 2021-01-04 10:26:59 +01:00
config.h.in offload-defaulted: Config option to silently ignore uninstalled offload compilers 2021-04-28 18:46:47 +02:00
configure offload-defaulted: Config option to silently ignore uninstalled offload compilers 2021-04-28 18:46:47 +02:00
configure.ac offload-defaulted: Config option to silently ignore uninstalled offload compilers 2021-04-28 18:46:47 +02:00
configure.tgt [gcn] Work-around libgomp 'error: array subscript 0 is outside array bounds of ‘__lds struct gomp_thread * __lds[0]’ [-Werror=array-bounds]' some more [PR101484] 2021-07-20 09:14:28 +02:00
critical.c Update copyright years. 2021-01-04 10:26:59 +01:00
env.c OpenMP 5.1: Add proc-bind 'primary' support 2021-08-12 15:49:49 +02:00
error.c openmp: Implement the error directive 2021-08-20 11:36:52 +02:00
fortran.c openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
hashtab.h libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
icv-device.c openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
icv.c Update copyright years. 2021-01-04 10:26:59 +01:00
iter.c Update copyright years. 2021-01-04 10:26:59 +01:00
iter_ull.c Update copyright years. 2021-01-04 10:26:59 +01:00
libgomp-plugin.c Update copyright years. 2021-01-04 10:26:59 +01:00
libgomp-plugin.h openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
libgomp.h Fix OpenACC "ephemeral" asynchronous host-to-device copies 2021-07-27 11:16:27 +02:00
libgomp.map openmp: Implement the error directive 2021-08-20 11:36:52 +02:00
libgomp.spec.in
libgomp.texi OpenMP 5.1: Add proc-bind 'primary' support 2021-08-12 15:49:49 +02:00
libgomp_f.h.in Update copyright years. 2021-01-04 10:26:59 +01:00
libgomp_g.h openmp: Implement the error directive 2021-08-20 11:36:52 +02:00
lock.c Update copyright years. 2021-01-04 10:26:59 +01:00
loop.c Update copyright years. 2021-01-04 10:26:59 +01:00
loop_ull.c Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-async.c Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-cuda.c Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-host.c Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-init.c Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-int.h Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-mem.c Fix OpenACC "ephemeral" asynchronous host-to-device copies 2021-07-27 11:16:27 +02:00
oacc-parallel.c libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
oacc-plugin.c Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-plugin.h Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-profiling.c Update copyright years. 2021-01-04 10:26:59 +01:00
oacc-target.c GCN libgomp port 2019-11-13 12:38:04 +00:00
omp.h.in OpenMP 5.1: Add proc-bind 'primary' support 2021-08-12 15:49:49 +02:00
omp_lib.f90.in Fortran/OpenMP: Add memory routines existing for C/C++ 2021-08-18 11:15:47 +02:00
omp_lib.h.in Fortran/OpenMP: Add memory routines existing for C/C++ 2021-08-18 11:15:47 +02:00
openacc.f90 Update copyright years. 2021-01-04 10:26:59 +01:00
openacc.h Update copyright years. 2021-01-04 10:26:59 +01:00
openacc_lib.h Update copyright years. 2021-01-04 10:26:59 +01:00
ordered.c Update copyright years. 2021-01-04 10:26:59 +01:00
parallel.c Update copyright years. 2021-01-04 10:26:59 +01:00
priority_queue.c openmp: Add support for the OpenMP 5.0 task detach clause 2021-01-16 12:58:13 -08:00
priority_queue.h openmp: Add support for the OpenMP 5.0 task detach clause 2021-01-16 12:58:13 -08:00
scope.c openmp: Implement OpenMP 5.1 scope construct 2021-08-17 09:30:09 +02:00
sections.c Update copyright years. 2021-01-04 10:26:59 +01:00
secure_getenv.h Update copyright years. 2021-01-04 10:26:59 +01:00
single.c Update copyright years. 2021-01-04 10:26:59 +01:00
splay-tree.c Update copyright years. 2021-01-04 10:26:59 +01:00
splay-tree.h Update copyright years. 2021-01-04 10:26:59 +01:00
target.c openmp: Implement omp_get_device_num routine 2021-08-05 23:29:03 +08:00
task.c openmp: Notify team barrier of pending tasks in omp_fulfill_event 2021-05-17 13:15:08 -07:00
taskloop.c openmp: Fix up taskloop reduction ICE if taskloop has no iterations [PR100471] 2021-05-11 09:07:47 +02:00
team.c libgomp: Silence false positive -Wmaybe-uninitialized warning [PR99984] 2021-04-09 10:18:47 +02:00
teams.c Update copyright years. 2021-01-04 10:26:59 +01:00
work.c Update copyright years. 2021-01-04 10:26:59 +01:00