From: Ghjuvan Lacambre Date: Mon, 17 Nov 2025 15:23:50 +0000 (+0100) Subject: ada: sem_ch13.adb: accept VADS inline asm in Relaxed RM Semantics mode X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52d71516634642bf99108fe7cfbfcbc46639518e;p=thirdparty%2Fgcc.git ada: sem_ch13.adb: accept VADS inline asm in Relaxed RM Semantics mode VADS inline assembly works by using a qualified expression for one of the types defined in the Machine_Code package, e.g. procedure P is begin code_2'(INSTR, OPERAND1, OPERAND2); end y; This is different from GNAT's own inline assembly machinery, which instead expects a call to Machine_Code.ASM with a set of differently-typed arguments. This incompatibility is preventing GNATSAS' GNAT-Warnings engine from analyzing VADS code, hence we adapt sem_ch13.adb to not fail on such constructs when GNAT is running under both Check_Semantics_Only_Mode and Relaxed_RM_Semantics mode. gcc/ada/ChangeLog: * sem_ch13.adb (Analyze_Code_Statement): Do not emit error message when only checking relaxed semantics. --- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 98c3335e593..b90c7301895 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -8482,7 +8482,15 @@ package body Sem_Ch13 is if Etype (Expression (N)) = Any_Type then return; elsif not Is_RTE (Etype (Expression (N)), RE_Asm_Insn) then - Error_Msg_N ("incorrect type for code statement", N); + + -- Only emit an error message when not running in Relaxed RM + -- Semantics. This enables GNATSAS' GNAT Warnings engine to work on + -- VADS codebases. + + if not (Check_Semantics_Only_Mode and then Relaxed_RM_Semantics) then + Error_Msg_N ("incorrect type for code statement", N); + end if; + return; end if;