Fix recursion calls in Remove_Side_Effects
This commit fixes a latent issue in the Ada compiler's `Remove_Side_Effects` routine related to recursion calls.
A latent problem in the Ada compiler’s Remove_Side_Effects routine, introduced when the Renaming_Req formal was added, has been resolved. This issue affected recursion calls within the routine. The fix ensures proper propagation of actual parameters during recursion, except for side-effect free attributes whose expressions are also side-effect free, improving the behavior of this routine without introducing functional changes.
In Details
The commit addresses an issue in exp_util.adb within the Remove_Side_Effects routine. The fix involves propagating actuals in recursion calls, unless dealing with a known side-effect free attribute whose expressions are also side-effect free. The problem was triggered by the Renaming_Req formal. Search context: Ada compiler Remove_Side_Effects exp_util.adb Renaming_Req
For Context
In compiler optimization, side effects are changes to the program's state that occur as a result of evaluating an expression or executing a statement. The Remove_Side_Effects routine in the Ada compiler attempts to remove unnecessary side effects. This commit fixes an internal issue related to how this routine handles recursion, ensuring that the removal process is performed accurately. Search context: Ada compiler Remove_Side_Effects exp_util.adb Renaming_Req