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

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Mon Aug 12 09:08:00 GMT 2019


Author: pmderodat
Date: Mon Aug 12 08:59:58 2019
New Revision: 274293

URL: https://gcc.gnu.org/viewcvs?rev=274293&root=gcc&view=rev
Log:
[Ada] Suppress_Initialization not respected for private subtypes

The compiler fails to suppress initialization on a variable of a subtype
of a private type (such as System.Address) even though the subtype has
aspect Suppress_Initialization. This can lead to errors on object
declarations specified with Thread_Local_Storage when Initialize_Scalars
is applied (as well as leading to default initialization when it
shouldn't).

2019-08-12  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* sem_prag.adb (Analyze_Pragma, Pragma_Suppress_Initialization):
	For private types, set the Suppress_Initialization flag on the
	Full_View of the entity rather than the entity's base type.

gcc/testsuite/

	* gnat.dg/suppress_initialization2.adb,
	gnat.dg/suppress_initialization2.ads: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/suppress_initialization2.adb
    trunk/gcc/testsuite/gnat.dg/suppress_initialization2.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_prag.adb
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list