From: Piotr Trojanek Date: Tue, 8 Mar 2022 16:37:29 +0000 (+0100) Subject: [Ada] Improve building of untagged equality X-Git-Tag: basepoints/gcc-14~6728 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90fadb50df34d11348ec67a1cbbaeac8a28c2da3;p=thirdparty%2Fgcc.git [Ada] Improve building of untagged equality When checking components of a record type for their own user-defined equality function it is enough to find just one such a component. Cleanup related to handling of user-defined equality in GNATprove. gcc/ada/ * exp_ch3.adb (Build_Untagged_Equality): Exit early when the outcome of a loop is already known. --- diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 018f88b1752..dfbbc62b4d6 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -4541,6 +4541,7 @@ package body Exp_Ch3 is and then Present (User_Defined_Eq (Etype (Comp))) then Build_Eq := True; + exit; end if; Next_Component (Comp);