public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/113036] New: GNAT BUG DETECTED ICE box triggered by a default value that is a nested iterated aggregate
@ 2023-12-15 18:40 saulius.grazulis at bti dot vu.lt
  2023-12-20 10:07 ` [Bug ada/113036] assertion failure on " ebotcazou at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: saulius.grazulis at bti dot vu.lt @ 2023-12-15 18:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113036

            Bug ID: 113036
           Summary: GNAT BUG DETECTED ICE box triggered by a default value
                    that is a nested iterated aggregate
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: saulius.grazulis at bti dot vu.lt
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 56889
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56889&action=edit
A Minimal Working Example

When a discriminated record type has an 2D array a as a component, and a
default initialization value with nested iterated arrays is provided, a GNAT
BUG DETECTED box is triggered:

+ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/saulius/install/gcc/gcc-13.2.0-git-master-d1647917006/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure
--prefix=/home/saulius/install/gcc/gcc-13.2.0-git-master-d1647917006
--enable-languages=c,c++,ada,fortran --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231214 (experimental) (GCC) 

+ uname -a
Linux tasmanijos-velnias 5.4.0-167-generic #184-Ubuntu SMP Tue Oct 31 09:21:49
UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

+ lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description:    Linux Mint 20.1
Release:        20.1
Codename:       ulyssa

+ gnatmake pm_type_default_not_ok.adb
gcc -c pm_type_default_not_ok.adb
+===========================GNAT BUG DETECTED==============================+
| 14.0.0 20231214 (experimental) (x86_64-pc-linux-gnu) Assert_Failure failed
precondition from sinfo-nodes.ads:3628|
| Error detected at pm_type_default_not_ok.adb:9:4                         |
| Compiling pm_type_default_not_ok.adb                                     |
| 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.                                       |
+==========================================================================+

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).

pm_type_default_not_ok.adb

compilation abandoned
gnatmake: "pm_type_default_not_ok.adb" compilation error

$ cat pm_type_default_not_ok.adb 
pragma Ada_2022;

procedure PM_Type_Default_Not_OK is

   type One_Or_Zero is range 0 .. 1;

   type Permutation_Matrix_Array is array (Positive range <>, Positive range
<>) of One_Or_Zero;

   type Permutation_Matrix (N : Positive) is record
      A : Permutation_Matrix_Array (1 .. N, 1 .. N) :=
        (for I in 1 .. N => (for J in 1 .. N => 0));
   end record;

begin
   null;
end;

Not nesting the value, (e.g. having (others => 0)), or using the same iterated
expression in an assignment (as opposed to initialization) works OK.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug ada/113036] assertion failure on default value that is a nested iterated aggregate
  2023-12-15 18:40 [Bug ada/113036] New: GNAT BUG DETECTED ICE box triggered by a default value that is a nested iterated aggregate saulius.grazulis at bti dot vu.lt
@ 2023-12-20 10:07 ` ebotcazou at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-12-20 10:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113036

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|GNAT BUG DETECTED ICE box   |assertion failure on
                   |triggered by a default      |default value that is a
                   |value that is a nested      |nested iterated aggregate
                   |iterated aggregate          |
                 CC|                            |ebotcazou at gcc dot gnu.org
   Last reconfirmed|                            |2023-12-20
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This has apparently never worked indeed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-20 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-15 18:40 [Bug ada/113036] New: GNAT BUG DETECTED ICE box triggered by a default value that is a nested iterated aggregate saulius.grazulis at bti dot vu.lt
2023-12-20 10:07 ` [Bug ada/113036] assertion failure on " ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).