From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A79823858D35; Wed, 15 Feb 2023 11:28:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A79823858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676460524; bh=SZGlIhki9vLCbZbNks2Ad2sIR12/AxUh8Tz0pk5+GME=; h=From:To:Subject:Date:From; b=qdO6Sl/qW5rifawHL7XjdW6cd03ngFY3pLAPrn7IBHmHs8/x42RxtZTIwsTMuwvM7 TthPpO4ONgmU1cwLHTvwYlLGlVoJUz8IfLLxhgRFOJup5m22cyz/pvX58ZpAcsaAEH HXN1SuBj37BmS4ur6qBcLqNZgXCztwC0TSCpw2PQ= From: "simon at pushface dot org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBhZGEvMTA4ODAxXSBOZXc6IElDRSwgdGFza+KAmXMgc2Vj?= =?UTF-8?B?b25kYXJ5X3N0YWNrX3NpemUgZnJvbSBwYXJlbnQgZGlzY3JpbWluYW50?= Date: Wed, 15 Feb 2023 11:28:43 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon at pushface dot org 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 cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108801 Bug ID: 108801 Summary: ICE, task=E2=80=99s 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=3D54464&action=3Dedit Reproducer An instance of a task type is declared in a record with a discriminant Secondary_Storage_Size. The task=E2=80=99s Secondary_Storage_Size is specif= ied using the record=E2=80=99s 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'Cla= ss; Secondary_Stack_Size : Natural) with Secondary_Stack_Size =3D> 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 =3D> 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 happe= ns: $ gnatmake -c -u -f demo.ads gcc -c demo.ads +=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+ | 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. | +=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). demo.ads compilation abandoned gnatmake: "demo.ads" compilation error This also happens with 10.1, 11.2, but not with 9.1.=