From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CAC083856973; Fri, 28 Jul 2023 14:12:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CAC083856973 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690553526; bh=dFO+26eNLIS4pt7VV4tXxuFpA9+w241qqGgyEII95/s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SF1NO2sjsEIwdHXzMQXbD98g8fi+tfIPyPAir7iBwT+zEWLRz71LqxZrwHmXx1/WW KfBYq+c1sWc/1DxjN0OGrEtOhLtNI866mTWw0I12682ORsBJO+raoXa1EHvywlUAXM 7UvDDQegkbjqlqQbZUI/rQzsKRY6y/0hEFSc8WrA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/109729] gm2 (14.0.0) does not like a CHAR type FOR loop control variable any more Date: Fri, 28 Jul 2023 14:12:05 +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: RESOLVED X-Bugzilla-Resolution: FIXED 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=3D109729 --- Comment #5 from CVS Commits --- The releases/gcc-13 branch has been updated by Gaius Mulley : https://gcc.gnu.org/g:3e9aaa9bcb2fc64e64f4e8a2aa0f6f7395a21c52 commit r13-7622-g3e9aaa9bcb2fc64e64f4e8a2aa0f6f7395a21c52 Author: Gaius Mulley Date: Fri Jul 28 15:00:29 2023 +0100 PR modula2/109729 cannot use a CHAR type as a FOR loop iterator This patch introduces a new quadruple ArithAddOp which is used in the construction of FOR loop to ensure that when constant folding is applied it does not concatenate two constant char operands into a string constant. Overloading only occurs with constant operands. gcc/m2/ChangeLog: PR modula2/109729 PR modula2/110246 * gm2-compiler/M2GenGCC.mod (CodeStatement): Detect ArithAddOp and call CodeAddChecked. (ResolveConstantExpressions): Detect ArithAddOp and call FoldArithAdd. (FoldArithAdd): New procedure. (FoldAdd): Refactor to use FoldArithAdd. * gm2-compiler/M2Quads.def (QuadOperator): Add ArithAddOp. * gm2-compiler/M2Quads.mod: Remove commented imports. (QuadFrame): Changed comments to use GNU coding standards. (ArithPlusTok): New global variable. (BuildForToByDo): Use ArithPlusTok instead of PlusTok. (MakeOp): Detect ArithPlusTok and return ArithAddOp. (WriteQuad): Add ArithAddOp clause. (WriteOperator): Add ArithAddOp clause. (Init): Initialize ArithPlusTok. gcc/testsuite/ChangeLog: PR modula2/109729 * gm2/pim/run/pass/ForChar.mod: New test. (cherry picked from commit ac7c9954ece9a75c5e7c3b76a4800f2432002487) Signed-off-by: Gaius Mulley =