Go to file
Chung-Lin Tang 87dcdc3deb OpenACC 2.7: Connect readonly modifier to points-to analysis
This patch links the readonly modifier to points-to analysis.

In front-ends, firstprivate pointer clauses are marked with
OMP_CLAUSE_MAP_POINTS_TO_READONLY set true, and later during lowering the
receiver side read of pointer has VAR_POINTS_TO_READONLY set true, which later
directs SSA_NAME_POINTS_TO_READONLY_MEMORY set to true during SSA conversion.

SSA_NAME_POINTS_TO_READONLY_MEMORY is an already existing flag connected with
alias oracle routines in tree-ssa-alias.cc, thus making the readonly-modifier
effective in hinting points-to analysis.

Currently have one testcase c-c++-common/goacc/readonly-2.c where we can
demonstrate 'readonly' can avoid a clobber by function call.

This patch is ported from upstream submission:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/648728.html

gcc/c-family/ChangeLog:

	* c-omp.cc (c_omp_address_inspector::expand_array_base):
	Set OMP_CLAUSE_MAP_POINTS_TO_READONLY on pointer clause.
	(c_omp_address_inspector::expand_component_selector): Likewise.

gcc/fortran/ChangeLog:

	* trans-openmp.cc (gfc_trans_omp_array_section):
	Set OMP_CLAUSE_MAP_POINTS_TO_READONLY on pointer clause.

gcc/ChangeLog:

	* gimple-expr.cc (copy_var_decl): Copy VAR_POINTS_TO_READONLY
	for VAR_DECLs.
	* omp-low.cc (lower_omp_target): Set VAR_POINTS_TO_READONLY for
	variables of receiver refs.
	* tree-pretty-print.cc (dump_omp_clause):
	Print OMP_CLAUSE_MAP_POINTS_TO_READONLY.
	(dump_generic_node): Print SSA_NAME_POINTS_TO_READONLY_MEMORY.
	* tree-ssanames.cc (make_ssa_name_fn): Set
	SSA_NAME_POINTS_TO_READONLY_MEMORY if DECL_POINTS_TO_READONLY is set.
	* tree.h (OMP_CLAUSE_MAP_POINTS_TO_READONLY): New macro.
	(VAR_POINTS_TO_READONLY): New macro.

gcc/testsuite/ChangeLog:

	* c-c++-common/goacc/readonly-1.c: Adjust testcase.
	* c-c++-common/goacc/readonly-2.c: New testcase.
	* gfortran.dg/goacc/readonly-1.f90: Adjust testcase.
2024-11-11 17:16:26 +00:00
.github Minor formatting fix for newly-added file from previous commit 2023-11-01 19:28:56 -04:00
c++tools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
config Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
contrib Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
fixincludes Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
gcc OpenACC 2.7: Connect readonly modifier to points-to analysis 2024-11-11 17:16:26 +00:00
gnattools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
gotools Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
include Merge branch 'releases/gcc-14' into devel/omp/gcc-14 2024-08-01 11:09:11 +02:00
INSTALL
libada Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libatomic Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libbacktrace Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcc1 Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcody Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libcpp Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libdecnumber Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libffi Merge branch 'releases/gcc-14' into devel/omp/gcc-14 2024-08-01 11:09:11 +02:00
libgcc Merge branch 'releases/gcc-14' into devel/omp/gcc-14 2024-09-03 10:54:46 +02:00
libgfortran Merge branch 'releases/gcc-14' into devel/omp/gcc-14 2024-08-01 11:09:11 +02:00
libgm2 Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libgo libgo: bump libgo version for GCC 14 release 2024-02-05 11:28:30 -08:00
libgomp Merge branch 'releases/gcc-14' into devel/omp/gcc-14 2024-09-03 10:54:46 +02:00
libgrust Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libiberty Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libitm Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libobjc Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libphobos Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libquadmath Daily bump. 2024-08-07 00:21:46 +00:00
libsanitizer Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libssp Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
libstdc++-v3 Daily bump. 2024-08-04 00:20:46 +00:00
libvtv Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
lto-plugin Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
maintainer-scripts Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
zlib Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
.dir-locals.el
.gitattributes
.gitignore *: add modern gettext 2023-11-14 00:47:11 +01:00
ABOUT-NLS
ar-lib
ChangeLog Update ChangeLog and version files for release 2024-08-01 08:18:20 +00:00
ChangeLog.jit
ChangeLog.omp Disable libstdc++ dependency for libffi 2024-05-07 11:49:57 +02:00
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure build: Use of cargo not yet supported here in Canadian cross configurations 2024-04-16 09:43:47 +02:00
configure.ac build: Use of cargo not yet supported here in Canadian cross configurations 2024-04-16 09:43:47 +02:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4 Build: fix error in fixinclude configure 2023-11-22 11:54:33 +01:00
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS: Update my email address 2024-04-04 16:39:52 +02:00
Makefile.def Disable libstdc++ dependency for libffi 2024-05-07 11:49:57 +02:00
Makefile.in Disable libstdc++ dependency for libffi 2024-05-07 11:49:57 +02:00
Makefile.tpl Fix up postboot dependencies [PR106472] 2024-04-02 13:40:27 +02:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
SECURITY.txt SECURITY.txt: Drop "exploitable" in reference to hardening issues 2024-01-09 10:49:01 -05:00
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.