diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2023-06-23 19:01:05 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-07-03 15:26:13 +0200 |
commit | 37449332ddb5d34ac1cb4f25b0d8b5ba2ad9d0f4 (patch) | |
tree | f4d8af80f045ce9605958c3316a5861429cbaa57 /gcc/tree-vectorizer.cc | |
parent | abc202d8c58e75940e27b324756c68504965f0ee (diff) | |
download | gcc-37449332ddb5d34ac1cb4f25b0d8b5ba2ad9d0f4.zip gcc-37449332ddb5d34ac1cb4f25b0d8b5ba2ad9d0f4.tar.gz gcc-37449332ddb5d34ac1cb4f25b0d8b5ba2ad9d0f4.tar.bz2 |
ada: Fix renaming of predefined equality operator for unchecked union types
The problem is that the predefined equality operator for unchecked union
types is implemented out of line by invoking a function that takes more
parameters than the two operands, which means that the renaming is not
seen as type conforming with this function and, therefore, is rejected.
The way out is to implement these additional parameters as "extra" formal
parameters, since this kind of parameters is not taken into account for
semantic checks. The change also factors out the duplicated generation
of actuals for these additional parameters into a single procedure.
gcc/ada/
* exp_ch3.ads (Build_Variant_Record_Equality): Add Spec_Id as second
parameter.
* exp_ch3.adb (Build_Variant_Record_Equality): For unchecked union
types, build the additional parameters as extra formal parameters.
(Expand_Freeze_Record_Type.Build_Variant_Record_Equality): Pass
Empty as Spec_Id in call to Build_Variant_Record_Equality.
* exp_ch4.ads (Expand_Unchecked_Union_Equality): New procedure.
* exp_ch4.adb (Expand_Composite_Equality): In the presence of a
function implementing composite equality, do not special case the
unchecked union types, and only convert the operands if the base
types are not the same like in Build_Equality_Call.
(Build_Equality_Call): Do not special case the unchecked union types
and relocate the operands only once.
(Expand_N_Op_Eq): Do not special case the unchecked union types.
(Expand_Unchecked_Union_Equality): New procedure implementing the
specific expansion of calls to the predefined equality function.
* exp_ch6.adb (Is_Unchecked_Union_Equality): New predicate.
(Expand_Call): Call Is_Unchecked_Union_Equality to determine whether
to call Expand_Unchecked_Union_Equality or Expand_Call_Helper.
* exp_ch8.adb (Build_Body_For_Renaming): Set Has_Delayed_Freeze flag
earlier on Id and pass Id in call to Build_Variant_Record_Equality.
Diffstat (limited to 'gcc/tree-vectorizer.cc')
0 files changed, 0 insertions, 0 deletions