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

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Tue Dec 11 11:12:00 GMT 2018


Author: pmderodat
Date: Tue Dec 11 11:12:26 2018
New Revision: 267015

URL: https://gcc.gnu.org/viewcvs?rev=267015&root=gcc&view=rev
Log:
[Ada] Do not expand code inside ignored ghost bodies

While ignored ghost code is not compiled into the executable, it may
lead to compilation errors when it makes use of language features
requiring runtime support that is not available in the available runtime
library.  These errors are spurious, as the executable will never call
in these runtime units.

This patch deactivates the expansion of code inside ignored ghost bodies
of subprograms and packages, so that this code is still checked for
possible semantic errors, but it does not force the presence of useless
runtime units.

There is no impact on the executable produced.

2018-12-11  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Deactivate
	expansion in ignored ghost subprogram body.
	* sem_ch7.adb (Analyze_Package_Body_Helper): Deactivate
	expansion in ignored ghost package body.

gcc/testsuite/

	* gnat.dg/ghost4.adb: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/ghost4.adb
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_ch6.adb
    trunk/gcc/ada/sem_ch7.adb
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list