From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AF13C385AE43; Thu, 7 Dec 2023 13:11:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF13C385AE43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701954710; bh=Zrofo50qnm3y19+uFaDcIHx/TYzql4Su3YqdjBMYgkA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eavVpY3IIW70UwuN5+biv28A5lSvelxeL5n8Vkpn2XWHfh2mK6FTO9xnyV3dgdX0D 9eohxMmnq4PGCCDoIT2lwyMOaFnpnCq8nYe3UiIbxbjaoGsVuwsq2vfhEo2vH1vFn9 Sa769Rni6oOGW7oD7iIlXrZxusUXrxhCxi5+TAqA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/112893] gm2 fails to detect procedure address actual parameter is incompatible with cardinal formal parameter Date: Thu, 07 Dec 2023 13:11:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: gaius at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112893 --- Comment #5 from GCC Commits --- The master branch has been updated by Gaius Mulley : https://gcc.gnu.org/g:f8c8aebc597611b8d37edce165a891d00e23a9c1 commit r14-6271-gf8c8aebc597611b8d37edce165a891d00e23a9c1 Author: Gaius Mulley Date: Thu Dec 7 13:10:49 2023 +0000 PR modula2/112893 detect procedure address incompatible with cardinal in iso In ISO m2 the type cardinal is assignment incompatible with address (but it is allowed in PIM). The patch also extends the type checker to incl= ude procedures (which appear as having GetType () =3D address). At some po= int this should be be improved to use a pointer to proc type. Perhaps in the next stage1. For now this will catch procedures being passed as actual parameters in= to a formal cardinal parameter in ISO m2 (for example). gcc/m2/ChangeLog: PR modula2/112893 * gm2-compiler/M2Base.mod (Ass): Extend array to include proc r= ow and column. Allow PIM to assign cardinal variables to address variables. (Expr): Ditto. (Comp): Ditto. * gm2-compiler/M2Check.mod (getSType): New procedure function. Replace all occurances of GetSType with getSType. * gm2-compiler/M2GenGCC.mod (CodeParam): Rewrite format specifi= er error message. * gm2-compiler/M2Quads.mod (CheckProcTypeAndProcedure): Add tok= no parameter. * gm2-compiler/M2Range.def (InitTypesParameterCheck): Add tokno parameter. (InitParameterRangeCheck): Add tokno parameter. Remove EXPORT QUALIFIED list. (InitParameterRangeCheck): Add tokno parameter. * gm2-compiler/M2Range.mod (InitTypesParameterCheck): Add tokno parameter and pass tokno to PutRangeParam. (InitParameterRangeCheck): Add tokno parameter and pass tokno to PutRangeParam. (PutRangeParam): Add tokno parameter and assign to tokenNo. (FoldTypeParam): Rewrite format string. gcc/testsuite/ChangeLog: PR modula2/112893 * gm2/iso/fail/proccard.mod: New test. * gm2/pim/pass/proccard.mod: New test. Signed-off-by: Gaius Mulley =