aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-03-16 21:50:08 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-17 08:25:40 +0000
commitbc17882341b506a7e1052fa5be7ddbb3220cb2b1 (patch)
tree8569c4769e1a1c24bce85ede1b45d1d05f0a3b19 /gcc/ada/sem_ch3.adb
parentbc9aa450eb47e440a4b909a10a271fe074e896eb (diff)
downloadgcc-bc17882341b506a7e1052fa5be7ddbb3220cb2b1.zip
gcc-bc17882341b506a7e1052fa5be7ddbb3220cb2b1.tar.gz
gcc-bc17882341b506a7e1052fa5be7ddbb3220cb2b1.tar.bz2
[Ada] Enable current value propagation within pragma expressions
This patch fixes an odd incomplete optimization within pragma expressions. For example, in this code: X := True; pragma Assert (X = True); pragma Assert (X); the first assertion was eliminated by the frontend (regardless of the optimization switches), while the second assertion was only eliminated by the backend and only with switch -O1 or similar. The problem was that the current value propagation was disabled for references immediately within pragma argument associations. This was meant to avoid a crash when such a reference appears in pragma Inspection_Point, but this wasn't a proper fix. The proper solution is rather to not expand references in pragma Inspection_Point at all. Actually, this expansion was enabled to avoid a yet another crash, when the parameter of pragma Inspection_Point is a prival (i.e. a renaming of private protected component). It turns out that none of these suspicious problematic fixes is no longer necessary. Cleanup related to fixes of current value propagation in expansion of attribute Loop_Entry. gcc/ada/ * exp_ch2.adb (Expand_Current_Value): Remove special case for references immediately within pragma argument associations. * exp_prag.adb (Expand_Pragma_Inspection_Point): Remove special case for privals.
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
0 files changed, 0 insertions, 0 deletions