diff options
author | Javier Miranda <miranda@adacore.com> | 2018-08-21 14:47:05 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-08-21 14:47:05 +0000 |
commit | dc88759c874104bbf96cb56e44f2ea319541324a (patch) | |
tree | d89306d6d39ea8ac81f253ffbf96d891472603ff | |
parent | 5c0972ba85975672ae89ce70a562133a506689d1 (diff) | |
download | gcc-dc88759c874104bbf96cb56e44f2ea319541324a.zip gcc-dc88759c874104bbf96cb56e44f2ea319541324a.tar.gz gcc-dc88759c874104bbf96cb56e44f2ea319541324a.tar.bz2 |
[Ada] Crash compiling SPARK ghost functions with callgraph info
The compiler blows up generating the callgraph output of SPARK ghost
subprograms whose contracts invoke ghost functions.
2018-08-21 Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_cg.adb (Generate_CG_Output): Handle calls removed by the
expander.
From-SVN: r263722
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/exp_cg.adb | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index dee7064..e9e674b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-08-21 Javier Miranda <miranda@adacore.com> + + * exp_cg.adb (Generate_CG_Output): Handle calls removed by the + expander. + 2018-08-21 Ed Schonberg <schonberg@adacore.com> * layout.adb: Do not set size of access subprogram if unnesting. diff --git a/gcc/ada/exp_cg.adb b/gcc/ada/exp_cg.adb index 00f029b..f40dc7e 100644 --- a/gcc/ada/exp_cg.adb +++ b/gcc/ada/exp_cg.adb @@ -121,7 +121,14 @@ package body Exp_CG is for J in Call_Graph_Nodes.First .. Call_Graph_Nodes.Last loop N := Call_Graph_Nodes.Table (J); - if Nkind (N) in N_Subprogram_Call then + -- No action needed for subprogram calls removed by the expander + -- (for example, calls to ignored ghost entities). + + if Nkind (N) = N_Null_Statement then + pragma Assert (Nkind (Original_Node (N)) in N_Subprogram_Call); + null; + + elsif Nkind (N) in N_Subprogram_Call then Write_Call_Info (N); else pragma Assert (Nkind (N) = N_Defining_Identifier); |