aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2021-03-16 10:24:39 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-18 04:36:48 -0400
commit2a8dbd6b244df31819c378626007c45f001f7136 (patch)
tree8f7fce31417c3e5d84b3ef4c6155b0e50a696dfa
parenta30647690de250eba61f941bb2a2fd35fe3894fc (diff)
downloadgcc-2a8dbd6b244df31819c378626007c45f001f7136.zip
gcc-2a8dbd6b244df31819c378626007c45f001f7136.tar.gz
gcc-2a8dbd6b244df31819c378626007c45f001f7136.tar.bz2
[Ada] Do not clear Is_True_Constant flag on imported constants
gcc/ada/ * sem_prag.adb (Process_Import_Or_Interface): Do not artificially record a possible modification for a constant.
-rw-r--r--gcc/ada/sem_prag.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 3e6af33..4efb3fb 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -9136,7 +9136,10 @@ package body Sem_Prag is
Def_Id := Entity (Def_Id);
Kill_Size_Check_Code (Def_Id);
- Note_Possible_Modification (Get_Pragma_Arg (Arg1), Sure => False);
+ if Ekind (Def_Id) /= E_Constant then
+ Note_Possible_Modification
+ (Get_Pragma_Arg (Arg1), Sure => False);
+ end if;
else
Process_Convention (C, Def_Id);
@@ -9146,7 +9149,10 @@ package body Sem_Prag is
Mark_Ghost_Pragma (N, Def_Id);
Kill_Size_Check_Code (Def_Id);
- Note_Possible_Modification (Get_Pragma_Arg (Arg2), Sure => False);
+ if Ekind (Def_Id) /= E_Constant then
+ Note_Possible_Modification
+ (Get_Pragma_Arg (Arg2), Sure => False);
+ end if;
end if;
-- Various error checks