This combination led to a hole in function Is_Prologue_Renaming, causing
the generation of precondition checks too early.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* contracts.adb (Is_Prologue_Renaming): This function was
missing support for E_Constant which can also be generated in
protected objects.
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb
--- a/gcc/ada/contracts.adb
+++ b/gcc/ada/contracts.adb
@@ -2333,7 +2333,7 @@ package body Contracts is
-- A renamed private component is just a component of
-- _object, with an arbitrary name.
- elsif Ekind (Obj) = E_Variable
+ elsif Ekind (Obj) in E_Variable | E_Constant
and then Nkind (Pref) = N_Identifier
and then Chars (Pref) = Name_uObject
and then Nkind (Sel) = N_Identifier