This patch corrects an issue in the compiler whereby a renaming within a
declare expression may result in a crash in some systems.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* exp_dbug.adb (Debug_Renaming_Declaration): Add check for
Entity present for Ren to prevent looking at unanalyzed nodes
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb
--- a/gcc/ada/exp_dbug.adb
+++ b/gcc/ada/exp_dbug.adb
@@ -409,7 +409,9 @@ package body Exp_Dbug is
when N_Expanded_Name
| N_Identifier
=>
- if not Present (Renamed_Object (Entity (Ren))) then
+ if No (Entity (Ren))
+ or else not Present (Renamed_Object (Entity (Ren)))
+ then
exit;
end if;