aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorMarc Poulhiès <poulhies@adacore.com>2022-11-25 14:52:04 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-01-03 10:29:53 +0100
commit742084ada1e0974f5c7491fda65702e45bd07848 (patch)
treed6ce82392487f7e551768d8b7d11d3362f0eaee8 /gcc/expr.cc
parent48d9f7cb215f1af996788aee07808339a786a18d (diff)
downloadgcc-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