Internally generated static dispatch tables are preferably put in ROM,
so they are declared as constant where possible. However, the Object
Specific Dispatch tables were declared as variables, even though they
are initialized with static aggregates (with only literal integers) and
are never modified (either by the GNAT runtime nor by the code generated
by the GNAT compiler).
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Piotr Trojanek <troja...@adacore.com>
gcc/ada/
* exp_disp.adb (Make_Secondary_DT): Internally generated OSD
tables are now constant.
--- gcc/ada/exp_disp.adb
+++ gcc/ada/exp_disp.adb
@@ -4310,6 +4310,7 @@ package body Exp_Disp is
Append_To (Result,
Make_Object_Declaration (Loc,
Defining_Identifier => OSD,
+ Constant_Present => True,
Object_Definition =>
Make_Subtype_Indication (Loc,
Subtype_Mark =>