This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r273350 - in /trunk/gcc: ada/ChangeLog ada/sem_...


Author: pmderodat
Date: Wed Jul 10 09:02:47 2019
New Revision: 273350

URL: https://gcc.gnu.org/viewcvs?rev=273350&root=gcc&view=rev
Log:
[Ada] Crash on aggregate for limited type in extended return

This patch fixes a compiler abort on an extended return statement whose
expression is an aggregate (to be built in place) for a discriminated
record with a limited component. The build-in-place mechanism creates an
access type and a renaming declaration  through which individual
components are assigned. The renamed object is constrained because it is
limited, and the renaming declaration does not need to create a local
subtype indication for it, which may lead to type mismatches in the
back-end, and is in any case redundant. This patch extends this
optimization to the case of records that are limited only because of a
limitied component, and not because they are explicit declared limited.

2019-07-10  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch8.adb (Check_Constrained_Object): A record that is
	limited because of the presence of a limited component is
	constrained, and no subtype indiciation needs to be created for
	it, just as is the case for declared limited records.

gcc/testsuite/

	* gnat.dg/limited3.adb, gnat.dg/limited3_pkg.adb,
	gnat.dg/limited3_pkg.ads: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/limited3.adb
    trunk/gcc/testsuite/gnat.dg/limited3_pkg.adb
    trunk/gcc/testsuite/gnat.dg/limited3_pkg.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_ch8.adb
    trunk/gcc/testsuite/ChangeLog


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]