diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2023-06-26 20:33:53 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-07-04 10:08:29 +0200 |
commit | 65ea0024063eaa9623c8309edbe22e042325b7ea (patch) | |
tree | 425f7f0b07517e2d4f52f377c9066bee8feec7ce /gcc/rust/backend | |
parent | 2e80be632bfd09987425cb0bdd271659673e1e43 (diff) | |
download | gcc-65ea0024063eaa9623c8309edbe22e042325b7ea.zip gcc-65ea0024063eaa9623c8309edbe22e042325b7ea.tar.gz gcc-65ea0024063eaa9623c8309edbe22e042325b7ea.tar.bz2 |
ada: Do not unnecessarily use component-wise loop for slice assignment
This relaxes the condition under which Expand_Assign_Array leaves the
assignment to or from an array slice untouched. The main prerequisite
for the code generator is that everything be aligned on byte boundaries
and Is_Possibly_Unaligned_Slice is too strong a predicate for this, so
it is replaced by the combination of Possible_Bit_Aligned_Component and
Is_Bit_Packed_Array, modulo a change to Possible_Bit_Aligned_Component
to take into account the specific case of slices.
gcc/ada/
* exp_ch5.adb (Expand_Assign_Array): Adjust comment above the
calls to Possible_Bit_Aligned_Component on the LHS and RHS. Do not
call Is_Possibly_Unaligned_Slice in the slice case.
* exp_util.ads (Component_May_Be_Bit_Aligned): Add For_Slice
boolean parameter.
(Possible_Bit_Aligned_Component): Likewise.
* exp_util.adb (Component_May_Be_Bit_Aligned): Do not return False
for the slice of a small record or bit-packed array component.
(Possible_Bit_Aligned_Component): Pass For_Slice in recursive
calls, except in the slice case where True is passed, as well as
in call to Component_May_Be_Bit_Aligned.
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions