From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 84A913857014; Wed, 18 Aug 2021 22:32:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84A913857014 From: "demoonlit at panathenaia dot halfmoon.jp" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/101970] New: [11 regression] ICE on 'Enum_Rep for the enum that filled its representation range Date: Wed, 18 Aug 2021 22:32:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: demoonlit at panathenaia dot halfmoon.jp X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 22:32:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101970 Bug ID: 101970 Summary: [11 regression] ICE on 'Enum_Rep for the enum that filled its representation range Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: demoonlit at panathenaia dot halfmoon.jp Target Milestone: --- Created attachment 51322 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51322&action=3Dedit full test code Perhaps this is a regression by fixing the bug 101094. 'Enum_Rep causes GNAT bug Box, with the enum type containing the number of elements to fill just its (signed?) representation range. Thanks. #### test code #### Here is the abbreviated test code. The full code is attached. with Ada.Integer_Text_IO; with Ada.Text_IO; procedure test_enumrep2 is type T is (E80, ..., E00, ..., E7F); -- 256 elements for T use (E80 =3D> -16#80#, ..., E00 =3D> 16#00#, ..., E7F =3D> 16#7F#)= ; -- -128 to +127 for T'Size use 8; procedure P (X : T); pragma No_Inline (P); procedure P (X : T) is begin Ada.Integer_Text_IO.Put (T'Pos (X)); Ada.Integer_Text_IO.Put (T'Enum_Rep (X)); -- GNAT BUG DETECTED Ada.Text_IO.New_Line; end P; begin P (T'First); P (T'Last); end test_enumrep2; #### gcc-10.2.0 #### % /opt/ytomino/gcc-10.2.0/bin/gnatmake --version GNATMAKE 10.2.0 Copyright (C) 1995-2020, Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU= LAR PURPOSE. % /opt/ytomino/gcc-10.2.0/bin/gnatmake test_enumrep2.adb gcc -c test_enumrep2.adb gnatbind -x test_enumrep2.ali gnatlink test_enumrep2.ali % ./test_enumrep2=20 0 -128 255 127 It's fine. #### gcc-11.1.0 #### % /opt/ytomino/gcc-11.1.0/bin/gnatmake --version GNATMAKE 11.1.0 Copyright (C) 1995-2021, Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU= LAR PURPOSE. % /opt/ytomino/gcc-11.1.0/bin/gnatmake test_enumrep2.adb gcc -c test_enumrep2.adb gnatbind -x test_enumrep2.ali gnatlink test_enumrep2.ali % ./test_enumrep2 0 128 255 127 Note, T'Enum_Rep(T'First) returns the unsigned value in gcc-11.1 because bug 101094. #### gcc-11.2.0 #### % /opt/ytomino/gcc-11.2.0/bin/gnatmake --version GNATMAKE 11.2.0 Copyright (C) 1995-2021, Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU= LAR PURPOSE. % /opt/ytomino/gcc-11.2.0/bin/gnatmake test_enumrep2 gcc -c test_enumrep2.adb +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3DGNAT BUG DETECTED=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ | 11.2.0 (x86_64-linux-gnu) GCC error: | | in build_binary_op, at ada/gcc-interface/utils2.c:1164 | | Error detected at test_enumrep2.adb:107:44 | | Please submit a bug report; see https://gcc.gnu.org/bugs/ . | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact command that you entered. | | Also include sources listed below. | +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. Consider also -gnatd.n switch (see debug.adb). test_enumrep2.adb compilation abandoned gnatmake: "test_enumrep2.adb" compilation error=