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.
Tested on x86_64-pc-linux-gnu, committed on trunk
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
--- 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);