From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F8323858280; Wed, 14 Jun 2023 05:11:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F8323858280 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686719486; bh=lgmrOk9XWjLweA3D3UTU0PCc33ZvtQTKqRZrbYogIiE=; h=From:To:Subject:Date:From; b=AKaVQHCLk2GF+eBNFZmrkGdRsjExeVFIBVQbAJk5ubtz9z7Hp4XnGbBUexPgpTZ5P ilUgiCDkDCx85sph1yDqFKJU9dtd955b0xoWnK66YJk9M0zEfio8LSnAvB3sPxuw5Z HmRLEy6EEbbrBCXacF5OIhbl1RFtLaYnxm+qKuwY= From: "admin@tho-otto.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/110246] New: Using variables of type CHAR or BYTE as array index does not work Date: Wed, 14 Jun 2023 05:11:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: admin@tho-otto.de X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D110246 Bug ID: 110246 Summary: Using variables of type CHAR or BYTE as array index does not work Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: modula2 Assignee: gaius at gcc dot gnu.org Reporter: admin@tho-otto.de Target Milestone: --- In the following example: IMPLEMENTATION MODULE foo; FROM SYSTEM IMPORT BYTE; VAR arr: ARRAY['A'..'Z'] OF INTEGER; VAR ch: CHAR; BEGIN FOR ch :=3D 'A' TO 'Z' DO arr[ch] :=3D 0 END; END foo. I get error messages: /usr/lib64/gcc/x86_64-suse-linux/13/m2/m2pim/COROUTINES.def:37:1: error: ty= pe incompatibility, attempting to use a string ('_T38') when a CHAR is expected /usr/lib64/gcc/x86_64-suse-linux/13/m2/m2pim/COROUTINES.def:37:1: error: ty= pe incompatibility, attempting to use a string ('_T38') when a CHAR is expected /usr/lib64/gcc/x86_64-suse-linux/13/m2/m2pim/COROUTINES.def:37:1: error: ty= pe incompatibility, attempting to use a string ('_T38') when a CHAR is expected /usr/lib64/gcc/x86_64-suse-linux/13/m2/m2pim/COROUTINES.def:37:1: error: ty= pe incompatibility, attempting to use a string ('_T38') when a CHAR is expected (note also the totally unrelated source line in the error message) Changing the type of ch to BYTE i get instead: /usr/lib64/gcc/x86_64-suse-linux/13/m2/m2pim/COROUTINES.def:37:1: error: le= ft operand =E2=80=98ch=E2=80=99 of type =E2=80=98BYTE=E2=80=99 is not allowed = in binary expression +=