aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-08-17 11:02:51 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-10-01 06:13:39 +0000
commitea0b5b656a0e90bc9bb3ab0920796b24a9387d76 (patch)
tree8bfe97cd6152d52664f3591e26e030761f3a7ac9
parent29ada0e5a2ec9545a94fafeac21ac074d306376d (diff)
downloadgcc-ea0b5b656a0e90bc9bb3ab0920796b24a9387d76.zip
gcc-ea0b5b656a0e90bc9bb3ab0920796b24a9387d76.tar.gz
gcc-ea0b5b656a0e90bc9bb3ab0920796b24a9387d76.tar.bz2
[Ada] Subprogram_Variant in ignored ghost code
gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): Do not call Check_Subprogram_Variant if the subprogram is an ignored ghost entity. Otherwise the compiler crashes (in debug builds) or gives strange error messages (in production builds).
-rw-r--r--gcc/ada/exp_ch6.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index ffd1475..ce0bb80 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -4392,6 +4392,7 @@ package body Exp_Ch6 is
-- the current subprogram is called.
if Is_Subprogram (Subp)
+ and then not Is_Ignored_Ghost_Entity (Subp)
and then Same_Or_Aliased_Subprograms (Subp, Current_Scope)
then
Check_Subprogram_Variant;