From: Ghjuvan Lacambre Date: Tue, 16 Sep 2025 10:11:18 +0000 (+0200) Subject: ada: exp_ch6.adb: entirely disable call validation in CodePeer_Mode X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=405adc4e40e8d9181e64804c53f155947ef73c37;p=thirdparty%2Fgcc.git ada: exp_ch6.adb: entirely disable call validation in CodePeer_Mode This call validation was introduced a couple of months ago and caused GNAT2SCIL to fail a lot. It was determined that while being invalid for GCC, the tree was valid for GNAT2SCIL. Since it was thought that only the checking of the return type caused issue for CodePeer_Mode, this is the only part that disabled. Recent changes revealed that there also exists differences in the AST expected by GCC and GNAT2SCIL, and that checking the actuals also causes issues for GNAT2SCIL. We hence entirely disable the checking of calls in CodePeer_Mode instead of just the checking of return values. gcc/ada/ChangeLog: * exp_ch6.adb (Validate_Subprogram_Calls): Do not Check_Calls in CodePeer_Mode. (Check_Calls): Remove CodePeer_Mode special case. --- diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 2a32f3a9059..d48b8f22ba1 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -10592,19 +10592,11 @@ package body Exp_Ch6 is begin pragma Assert (Check_BIP_Actuals (Call_Node, Subp)); - - -- Do not attempt to verify the return type in CodePeer_Mode - -- as CodePeer_Mode is missing some expansion code that - -- results in trees that would be considered malformed for - -- GCC but aren't for GNAT2SCIL. - - if not CodePeer_Mode then -- Build-in-place function calls return their result by -- reference. - pragma Assert (not Is_Build_In_Place_Function (Subp) - or else Returns_By_Ref (Subp)); - end if; + pragma Assert (not Is_Build_In_Place_Function (Subp) + or else Returns_By_Ref (Subp)); end; -- Skip generic bodies @@ -10714,7 +10706,14 @@ package body Exp_Ch6 is pragma Assert (Serious_Errors_Detected = 0); - Check_Calls (N); + -- Do not attempt to verify the return type in CodePeer_Mode + -- as CodePeer_Mode is missing some expansion code that + -- results in trees that would be considered malformed for + -- GCC but aren't for GNAT2SCIL. + + if not CodePeer_Mode then + Check_Calls (N); + end if; end Validate_Subprogram_Calls; --------------