public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/108801] New: ICE, task’s secondary_stack_size from parent discriminant
@ 2023-02-15 11:28 simon at pushface dot org
  2023-02-23 12:06 ` [Bug ada/108801] " ebotcazou at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: simon at pushface dot org @ 2023-02-15 11:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108801
           Summary: ICE, task’s secondary_stack_size from parent
                    discriminant
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon at pushface dot org
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 54464
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54464&action=edit
Reproducer

An instance of a task type is declared in a record with a discriminant
Secondary_Storage_Size. The task’s Secondary_Storage_Size is specified using
the record’s corresponding discriminant, like so:

package Demo is

   type Event_Queue_Base (Secondary_Stack_Size : Natural)
      is tagged limited private;

private

   task type Dispatcher (The_Queue            : access Event_Queue_Base'Class;
                         Secondary_Stack_Size : Natural)
     with Secondary_Stack_Size => Secondary_Stack_Size;

   type Event_Queue_Base (Secondary_Stack_Size : Natural)
      is tagged limited record
         The_Dispatcher : Dispatcher
           (Event_Queue_Base'Access,
            Secondary_Stack_Size => Secondary_Stack_Size);
      end record;

end Demo;

All is fine in a normal compilation, but under the Ravenscar profile (or,
indeed, just pragma Restrictions (No_Implicit_Heap_Allocations)) this happens:

$ gnatmake -c -u -f demo.ads
gcc -c demo.ads
+===========================GNAT BUG DETECTED==============================+
| 12.2.0 (x86_64-apple-darwin15) Constraint_Error erroneous memory access  |
| Error detected at demo.ads:14:9                                          |
| Compiling demo.ads                                                       |
| 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).

demo.ads

compilation abandoned
gnatmake: "demo.ads" compilation error

This also happens with 10.1, 11.2, but not with 9.1.

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

end of thread, other threads:[~2023-05-07 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 11:28 [Bug ada/108801] New: ICE, task’s secondary_stack_size from parent discriminant simon at pushface dot org
2023-02-23 12:06 ` [Bug ada/108801] " ebotcazou at gcc dot gnu.org
2023-04-26  6:57 ` rguenth at gcc dot gnu.org
2023-04-26 16:10 ` simon at pushface dot org
2023-05-07 15:57 ` 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).