Go to file
Eric Botcazou 7f078d5b3e [Ada] Fix spurious instantiation error on private record type
This change was initially aimed at fixing a spurious instantiation error
due to a disambiguation issue which happens when a generic unit with two
formal type parameters is instantiated on a single actual type that is
private.

The compiler internally sets the Is_Generic_Actual_Type flag on the
actual subtypes built for the instantiation in order to ease the
disambiguation, but it would fail to set it on the full view if the
subtypes are private.  The change makes it so that the flag is properly
set and reset on the full view in this case.

But this uncovered an issue in Subtypes_Statically_Match, which was
relying on a stalled Is_Generic_Actual_Type flag set on a full view
outside of the instantiation to return a positive answer.  This bypass
was meant to solve an issue arising with a private discriminated record
type whose completion is a discriminated record type itself derived from
a private discriminated record type, which is used as actual type in an
instantiation in another unit, and the instantiation is used in a child
unit of the original unit.  In this case, the private and full views of
the generic actual type are swapped in the child unit, but there was a
mismatch between the chain of full and underlying full views of the
private discriminated record type and that of the generic actual type.

This secondary issue is solved by avoiding to skip the full view in the
preparation of the completion of the private subtype and by directly
constraining the underlying full view of the full view of the base type
instead of building an underlying full view from scratch.

2019-08-13  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch3.adb (Build_Underlying_Full_View): Delete.
	(Complete_Private_Subtype): Do not set the full view on the
	private subtype here.  If the full base is itself derived from
	private, do not re-derive the parent type but instead constrain
	an existing underlying full view.
	(Prepare_Private_Subtype_Completion): Do not get to the
	underlying full view, if any.  Set the full view on the private
	subtype here.
	(Process_Full_View): Likewise.
	* sem_ch12.adb (Check_Generic_Actuals): Also set
	Is_Generic_Actual_Type on the full view if the type of the
	actual is private.
	(Restore_Private_Views): Also reset Is_Generic_Actual_Type on
	the full view if the type of the actual is private.
	* sem_eval.adb (Subtypes_Statically_Match): Remove bypass for
	generic actual types.

gcc/testsuite/

	* gnat.dg/generic_inst10.adb, gnat.dg/generic_inst10_pkg.ads:
	New testcase.

From-SVN: r274357
2019-08-13 08:08:32 +00:00
INSTALL
config Add a build config for bootstrapping at -Og 2019-07-08 06:21:11 +00:00
contrib mklog/91048: Open ~/.mklog in string mode. 2019-07-02 08:54:31 +03:00
fixincludes [Darwin, fixincludes] Fix Darwin9/10 math.h issues. 2019-06-21 19:18:18 +00:00
gcc [Ada] Fix spurious instantiation error on private record type 2019-08-13 08:08:32 +00:00
gnattools PR81878: fix --disable-bootstrap --enable-languages=ada 2018-11-20 00:07:47 +00:00
gotools Makefile.am (check-go-tool): Only chmod check-go-dir if it exists. 2019-05-27 19:21:22 +00:00
include Fix file descriptor existence of MinGW. 2019-08-08 07:50:28 +00:00
intl iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. 2018-11-07 15:41:21 -07:00
libada Update copyright years. 2019-01-01 13:31:55 +01:00
libatomic [NetBSD] Add support for the Arm EABI. 2019-06-14 14:04:20 +00:00
libbacktrace Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and test_elf_64. 2019-05-24 11:55:21 +00:00
libcc1 [C++ PATCH] Using decls 2019-05-21 14:33:24 +00:00
libcpp * zh_TW.po: Update. 2019-08-09 23:02:08 +01:00
libdecnumber Update copyright years. 2019-01-01 13:31:55 +01:00
libffi Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
libgcc config.gcc (hppa*-*-netbsd*): New target. 2019-07-31 14:11:16 +00:00
libgfortran PR 53796 Make inquire(file=, recl=) conform to F2018 2019-08-07 10:34:10 +03:00
libgo runtime: expose the g variable 2019-07-15 21:17:16 +00:00
libgomp re PR fortran/91424 (Extend warnings about DO loops) 2019-08-12 20:21:37 +00:00
libhsail-rt Update copyright years. 2019-01-01 13:31:55 +01:00
libiberty Move is_valid_fd to filedescriptor.c file. 2019-08-12 07:36:48 +00:00
libitm Makefile.am (finclude): Remove. 2019-05-03 09:20:04 +02:00
libobjc re PR target/89093 (C++ exception handling clobbers d8 VFP register) 2019-04-23 12:03:41 +02:00
liboffloadmic PR other/16615 [1/5] 2019-01-09 16:37:45 -05:00
libphobos d/dmd: Merge upstream dmd f8e38c001 2019-06-16 07:50:07 +00:00
libquadmath quadmath.h (M_Eq, [...]): Use two more decimal places. 2019-08-02 09:59:19 +02:00
libsanitizer Fix sanitizer_common/sanitizer_posix_libcdep.cc compilation on Solaris 11.5 2019-06-26 10:43:08 +00:00
libssp Update copyright years. 2019-01-01 13:31:55 +01:00
libstdc++-v3 PR libstdc++/90361 add missing macro definition 2019-08-12 17:41:27 +01:00
libvtv Fix testsuite 2019-02-20 08:07:19 -08:00
lto-plugin lto-plugin, removed unused variable 2019-05-15 14:10:27 +00:00
maintainer-scripts update_web_docs_svn: Proceed even if the invocation of sphinx fails. 2019-08-04 22:31:54 +00:00
zlib Makefile.am (noinst_LTLIBRARIES): Rename libzgcj_convience.la to libz_convenience.la. 2019-01-21 17:23:58 +00:00
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog MAINTAINERS (Write After Approval): Remove myself, already listed in RISC-V port maitainer. 2019-07-08 13:21:21 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS (Write After Approval): Remove myself, already listed in RISC-V port maitainer. 2019-07-08 13:21:21 +00:00
Makefile.def Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
Makefile.in Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
Makefile.tpl re PR lto/85574 (LTO bootstapped binaries differ) 2019-05-02 13:58:47 +00:00
README
ar-lib Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
compile
config-ml.in Add D front-end, libphobos library, and D2 testsuite. 2018-10-28 19:51:47 +00:00
config.guess Update config.guess, config.sub (PR target/88535) 2019-01-03 11:28:27 +00:00
config.rpath
config.sub Update config.guess, config.sub (PR target/88535) 2019-01-03 11:28:27 +00:00
configure Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
configure.ac Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
depcomp
install-sh
libtool-ldflags
libtool.m4 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
symlink-tree
test-driver Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
ylwrap

README

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.