Go to file
Jakub Jelinek 7fa4db39b6 openmp: Call c_omp_adjust_map_clauses even for combined target [PR100902]
When looking at in_reduction support for target, I've noticed that
c_omp_adjust_map_clauses is not called for the combined target case.

The following patch fixes it.

Unfortunately, there are other issues.

One is (also mentioned in the PR) that currently the pointer attachment
stuff seems to be clause ordering dependent (the standard says that clause
ordering on the same construct does not matter), the baz and qux cases
in the PR are rejected while when swapped it is accepted.
Note, the order of clauses in GCC really is treated as insignificant
initially and only later on the compiler can adjust the ordering (e.g. when
we sort map clauses based on what they refer to etc.) and in particular,
clauses from parsing is reverse of the order in user code, while
c_omp_split_clauses performed for combined/composite constructs typically
reverses that ordering, i.e. makes it follow the user code ordering.

And another one is I'm slightly afraid c_omp_adjust_map_clauses might
misbehave in templates, though haven't tried to verify it with testcases.
When processing_template_decl, the non-dependent clauses will be handled
usually the same as when not in a template, but dependent clauses aren't
processed or only limited processing is done there, and rest is deferred
till later.  From quick skimming of c_omp_adjust_map_clauses, it seems
it might not be very happy about non-processed map clauses that might
still have the TREE_LIST representation of array sections, or might
not have finalized decls or base decls etc.
So, for this I wonder if cp_parser_omp_target (and other cp/parser.c
callers of c_omp_adjust_map_clauses) shouldn't call it only
if (!processing_template_decl) - perhaps you could add
cp_omp_adjust_map_clauses wrapper that would be
if (!processing_template_decl)
  c_omp_adjust_map_clauses (...);
- and call c_omp_adjust_map_clauses from within pt.c after the clauses
are tsubsted and finish_omp_clauses is called again.

2021-06-06  Jakub Jelinek  <jakub@redhat.com>

	PR c/100902
	* c-parser.c (c_parser_omp_target): Call c_omp_adjust_map_clauses
	even when target is combined with other constructs.

	* parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
	even when target is combined with other constructs.

	* c-c++-common/gomp/pr100902-1.c: New test.
2021-06-06 19:37:06 +02:00
c++tools Daily bump. 2021-05-26 00:16:41 +00:00
config Daily bump. 2021-05-19 00:16:45 +00:00
contrib Daily bump. 2021-05-26 00:16:41 +00:00
fixincludes
gcc openmp: Call c_omp_adjust_map_clauses even for combined target [PR100902] 2021-06-06 19:37:06 +02:00
gnattools
gotools
include
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcody
libcpp Daily bump. 2021-05-21 00:16:57 +00:00
libdecnumber
libffi
libgcc Fix my name in ChangeLog files. 2021-05-14 12:14:22 +02:00
libgfortran Daily bump. 2021-06-06 00:16:22 +00:00
libgo libgo: update configure to current sources 2021-05-18 19:57:54 -07:00
libgomp Daily bump. 2021-05-29 00:16:29 +00:00
libiberty Daily bump. 2021-06-06 00:16:22 +00:00
libitm
libobjc
liboffloadmic Daily bump. 2021-05-26 00:16:41 +00:00
libphobos Daily bump. 2021-05-15 00:16:27 +00:00
libquadmath
libsanitizer Daily bump. 2021-05-22 00:16:29 +00:00
libssp
libstdc++-v3 Daily bump. 2021-06-06 00:16:22 +00:00
libvtv
lto-plugin
maintainer-scripts Daily bump. 2021-05-15 00:16:27 +00:00
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2021-06-06 00:16:22 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure sim: leverage gnulib 2021-05-29 10:59:54 -04:00
configure.ac sim: leverage gnulib 2021-05-29 10:59:54 -04:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS Fix maintainers-verify.sh 2021-06-05 09:55:33 -04:00
Makefile.def sim: depend on gnulib 2021-05-18 17:45:19 -04:00
Makefile.in sim: depend on gnulib 2021-05-18 17:45:19 -04:00
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.