]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Improve efficiency of slice-of-component assignment
authorBob Duff <duff@adacore.com>
Tue, 20 Sep 2022 18:43:49 +0000 (14:43 -0400)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 29 Sep 2022 09:08:46 +0000 (11:08 +0200)
commit9ebc54a8c472e19d81e23ee4094f619e0437e673
tree2206b4ba85bbb92879881280c8788e15fb6cd1aa
parent01ea0437ead0dda3acd51cfb80a01de5feb56929
ada: Improve efficiency of slice-of-component assignment

This patch improves the efficiency of slice assignment when the left- or
right-hand side is a slice of a component or a slice of a slice.
Previously, the optimization was disabled in these cases, just in
case there might be a volatile or independent component lurking.
Now we explicitly check all the relevant subcomponents of
the prefix.

The previous version said (in exp_ch5.adb):

--  ...We could
--  complicate this code by actually looking for such volatile and
--  independent components.

and that's exactly what we are doing here.

gcc/ada/

* exp_ch5.adb
(Expand_Assign_Array_Loop_Or_Bitfield): Make the checks for
volatile and independent objects more precise.
gcc/ada/exp_ch5.adb