Fix endless loop when using Address aspect with dynamic addresses.
The compiler no longer enters an infinite loop when freezing objects with dynamic addresses.
The freezing machinery was inserting a freeze node into its own Actions list, causing Expand_N_Freeze_Entity to enter an endless loop. This commit fixes the logic in Remove_Init_Call to properly identify the initialization call, preventing the infinite loop. This bug occurred when using the Address aspect for objects with dynamic addresses.
In Details
The Ada compiler's freezing machinery ensures that objects with address aspects are properly initialized. The bug occurred because Remove_Init_Call in exp_util.adb was incorrectly identifying the initialization call, leading to an infinite loop during the expansion of Expand_N_Freeze_Entity. This patch addresses the bug by adding a check to ensure that the first actual denotes the expected variable modulo qualification and conversion.
For Context
The Ada compiler transforms high-level Ada code into lower-level representations that can be executed. During this process, the compiler needs to ensure that variables are initialized correctly, especially when their memory addresses are explicitly specified using the Address aspect. This commit fixes an infinite loop bug that occurred within this initialization process, specifically when dealing with objects whose addresses are not known at compile time (dynamic addresses).