diff options
author | Marc Poulhiès <poulhies@adacore.com> | 2022-11-25 14:52:04 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-01-03 10:29:53 +0100 |
commit | 742084ada1e0974f5c7491fda65702e45bd07848 (patch) | |
tree | d6ce82392487f7e551768d8b7d11d3362f0eaee8 /gcc/expr.cc | |
parent | 48d9f7cb215f1af996788aee07808339a786a18d (diff) | |
download | gcc-742084ada1e0974f5c7491fda65702e45bd07848.zip gcc-742084ada1e0974f5c7491fda65702e45bd07848.tar.gz gcc-742084ada1e0974f5c7491fda65702e45bd07848.tar.bz2 |
ada: Adapt frontend optimization for aggregate assignment
The frontend currently relies on gigi to use efficient assignment in
particular cases like:
Some_Var.all := (others => (others => 0));
gigi would use memset to clear memory pointed to by Some_Var.
In the case of an access with a Designated_Storage_Model aspect with a Copy_To
procedure, memset can't be used directly. Instead of simply disabling this
frontend/gigi optimization and having the frontend emit several assignments, a
temporary is used (through the new Build_Assignment_With_Temporary): gigi can
still memset it, and this temporary is then copied into the original
target (and the regular storage model mechanism handles it).
gcc/ada/
* exp_aggr.adb (Build_Assignment_With_Temporary): New.
(Expand_Array_Aggregate): Tune backend optimization
and insert a temporary in the case of an access with
Designated_Storage_Model aspect.
(Convert_Array_Aggr_In_Allocator): Likewise.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions