aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/ada.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-01-10 16:09:44 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-01-16 15:44:55 +0100
commit3b4c6e67710b09beccb7d0acf7f7257564d8a6f5 (patch)
treec47c8e0bd37c2dd0c0b88143cf8dcf23daa2dd16 /gcc/ada/gcc-interface/ada.h
parent39a7b603380c6f4383357a6ae1d6c516dc677f29 (diff)
downloadgcc-3b4c6e67710b09beccb7d0acf7f7257564d8a6f5.zip
gcc-3b4c6e67710b09beccb7d0acf7f7257564d8a6f5.tar.gz
gcc-3b4c6e67710b09beccb7d0acf7f7257564d8a6f5.tar.bz2
ada: Fix pessimization of some CW objects initialized with function call
The recent removal of the unconditional call to Remove_Side_Effects on the expression of an object declaration or an allocator with a class-wide type has introduced a pessimization in the former case for function calls that return a specific tagged type, because the object ultimately created on the primary stack has changed from being of a specific tagged type to being of the class-wide type, the latter type always formally requiring finalization. With the current finalization machinery, this means that a dispatching call to the Deep_Finalize routine is generated, which is unnecessary. Although this is a generic finalization issue with class-wide objects, this restores the previous behavior in this case to fix the pessimization for now. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Declaration): For a class-wide non- interface stand-alone object initialized by a function call, call Remove_Side_Effects on the expression to capture the result.
Diffstat (limited to 'gcc/ada/gcc-interface/ada.h')
0 files changed, 0 insertions, 0 deletions