From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from d208-15.smtp-out.ca-central-1.amazonses.com (d208-15.smtp-out.ca-central-1.amazonses.com [23.249.208.15]) by sourceware.org (Postfix) with ESMTPS id 65C413858D3C for ; Tue, 12 Sep 2023 21:46:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65C413858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=annexi-strayline.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ca-central-1.amazonses.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=k5b76xhpalcgrb3af3ji3mgpa4ove7c7; d=annexi-strayline.com; t=1694555210; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References; bh=ncY21FwUfUPRiwDbat4Zv6G3IJtbXvscYZlkaD7j0f4=; b=FF1pkXjYIdaoVNrFW2yEMI98Ple3ufY+zDsJ2Uo/AsqeofD57TxBfLfV1ensnDFh d60U94AkAro7f3EYfqxpOtLLIbz105rwdX8aoCcErnJgR4gCcMh0PAlCDDcEBRpBsAc //QSAYlnuuxL0k5pOmpk1fov1oRAH5z+SeB6HfoU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qpcfy54xse57bzmyicqs5kisv46vyagl; d=amazonses.com; t=1694555210; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=ncY21FwUfUPRiwDbat4Zv6G3IJtbXvscYZlkaD7j0f4=; b=Wzi+McZI9a0xj8lMhXUC2mtAO2dyUCsoR8BpJTR0plzLrJjNJV4FIDZK8vnUqKBn 5BFo2a4D/AfMGiGNZZaXLy86/2PEYtwBXdVr8ImBWbmltPRKbU6sZUMUQeu7sl24sPE oU/2EEAoJ31Vrtd9cxGfPoY4tn3UU4SLHzFswqT0= From: Richard Wai Message-ID: <010d018a8b5c83ad-6ef9ccb4-5aae-4b5f-af5b-3e94836c52a8-000000@ca-central-1.amazonses.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_A4A5E29D-55A4-4DDF-AD0C-749B04BFD347" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: [PATCH 1/2 v2] Ada: Synchronized private extensions are always limited Date: Tue, 12 Sep 2023 21:46:50 +0000 In-Reply-To: <20230901120818.GA1853171@adacore.com> Cc: gcc-patches@gcc.gnu.org, Eric Botcazou , Stephen Baird To: Arnaud Charlet References: <010d018a22c6e28b-dec61310-ac9d-44db-ab50-f08bedcd2ebe-000000@ca-central-1.amazonses.com> <20230901120602.GA1852336@adacore.com> <20230901120818.GA1853171@adacore.com> X-Mailer: Apple Mail (2.3731.700.6) Feedback-ID: 1.ca-central-1.KKZpW0DP3lOi0JgzUh4V+obZyxLGOx2dpGS8+RWwiDg=:AmazonSES X-SES-Outgoing: 2023.09.12-23.249.208.15 X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --Apple-Mail=_A4A5E29D-55A4-4DDF-AD0C-749B04BFD347 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Arno, No worries, and sorry for the trouble. I=E2=80=99m going to try using a = different client for the gcc mailing list, it doesn=E2=80=99t seem to = like Outlook. Thanks for catching that mistake! Please advise how I can get this patch actually applied, given my lack = of commit privilege. Revised patch attached! Thanks! --Apple-Mail=_A4A5E29D-55A4-4DDF-AD0C-749B04BFD347 Content-Disposition: attachment; filename=ada-synchronized-private-types-are-limited-v2.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="ada-synchronized-private-types-are-limited-v2.patch" Content-Transfer-Encoding: quoted-printable =46rom=20f87d0da43296b87cd242380a4077a167e5ea1291=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Richard=20Wai=20=0A= Date:=20Wed,=209=20Aug=202023=2001:54:48=20-0400=0ASubject:=20[PATCH=20= 1/2]=20ada:=20Consider=20that=20any=20synchronized=20private=20extension=20= is=0A=20always=20a=20limited=20type,=20even=20if=20it=20inherits=20from=20= a=20non-concurrent=20interface.=0A=20Add=20two=20regression=20tests=20= for=20two=20separate=20problems=20that=20arose=0A=0A---=0A=20= gcc/ada/sem_ch3.adb=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20|=2012=20+++--=0A=20= .../gnat.dg/sync_tag_discriminals.adb=20=20=20=20=20=20=20=20=20|=2051=20= +++++++++++++++++++=0A=20gcc/testsuite/gnat.dg/sync_tag_limited.adb=20=20= =20=20|=2050=20++++++++++++++++++=0A=203=20files=20changed,=20110=20= insertions(+),=203=20deletions(-)=0A=20create=20mode=20100644=20= gcc/testsuite/gnat.dg/sync_tag_discriminals.adb=0A=20create=20mode=20= 100644=20gcc/testsuite/gnat.dg/sync_tag_limited.adb=0A=0Adiff=20--git=20= a/gcc/ada/sem_ch3.adb=20b/gcc/ada/sem_ch3.adb=0Aindex=20= 042ace01724..48731a7bf04=20100644=0A---=20a/gcc/ada/sem_ch3.adb=0A+++=20= b/gcc/ada/sem_ch3.adb=0A@@=20-9494,9=20+9494,15=20@@=20package=20body=20= Sem_Ch3=20is=0A=20=0A=20=20=20=20=20=20=20--=20=20AI-419:=20Limitedness=20= is=20not=20inherited=20from=20an=20interface=20parent,=20so=20to=0A=20=20= =20=20=20=20=20--=20=20be=20limited=20in=20that=20case=20the=20type=20= must=20be=20explicitly=20declared=20as=0A-=20=20=20=20=20=20--=20=20= limited.=20However,=20task=20and=20protected=20interfaces=20are=20always=20= limited.=0A-=0A-=20=20=20=20=20=20if=20Limited_Present=20(Type_Def)=20= then=0A+=20=20=20=20=20=20--=20=20limited,=20or=20synchronized.=20While=20= task=20and=20protected=20interfaces=20are=0A+=20=20=20=20=20=20--=20=20= always=20limited,=20a=20synchronized=20private=20extension=20might=20not=20= inherit=0A+=20=20=20=20=20=20--=20=20from=20such=20interfaces,=20and=20= so=20we=20also=20need=20to=20recognize=20the=0A+=20=20=20=20=20=20--=20=20= explicit=20limitedness=20implied=20by=20a=20synchronized=20private=20= extension=0A+=20=20=20=20=20=20--=20=20that=20does=20not=20derive=20from=20= a=20synchronized=20interface=20(see=20RM-7.3(6/2)).=0A+=0A+=20=20=20=20=20= =20if=20Limited_Present=20(Type_Def)=0A+=20=20=20=20=20=20=20=20or=20= else=20Synchronized_Present=20(Type_Def)=0A+=20=20=20=20=20=20then=0A=20=20= =20=20=20=20=20=20=20=20Set_Is_Limited_Record=20(Derived_Type);=0A=20=0A=20= =20=20=20=20=20=20elsif=20Is_Limited_Record=20(Parent_Type)=0Adiff=20= --git=20a/gcc/testsuite/gnat.dg/sync_tag_discriminals.adb=20= b/gcc/testsuite/gnat.dg/sync_tag_discriminals.adb=0Anew=20file=20mode=20= 100644=0Aindex=2000000000000..b105acf6e98=0A---=20/dev/null=0A+++=20= b/gcc/testsuite/gnat.dg/sync_tag_discriminals.adb=0A@@=20-0,0=20+1,51=20= @@=0A+--=20This=20test=20is=20related=20to=20sync_tag_limited=20in=20= that=20previous=20versions=20of=20GNAT=0A+--=20failed=20to=20consider=20= a=20synchronized=20private=20extension=20as=20limited=20if=20it=20was=0A= +--=20not=20derrived=20from=20a=20synchronized=20interface=20(i.e.=20a=20= limited=20interface).=20Since=0A+--=20such=20a=20private=20type=20would=20= not=20be=20considered=20limited,=20GNAT=20would=20fail=20to=0A+--=20= correctly=20build=20the=20expected=20discriminals=20later=20needed=20by=20= the=20creation=20of=0A+--=20the=20concurrent=20type's=20"corresponding=20= record=20type",=20leading=20to=20a=20compilation=0A+--=20error=20where=20= the=20discriminants=20of=20the=20corresponding=20record=20type=20had=20= no=0A+--=20identifiers.=0A+--=0A+--=20This=20test=20is=20in=20addition=20= to=20sync_tag_limited=20because=20the=20sync_tag_limited=0A+--=20would=20= fail=20for=20"legality"=20reasons=20(default=20discriminants=20not=20= allowed=20for=0A+--=20a=20non-limited=20taged=20type).=20It=20is=20also=20= an=20opportunity=20to=20ensure=20that=20non-=0A+--=20defaulted=20= discriminated=20synchronized=20private=20extensions=20work=20as=20= expected.=0A+=0A+--=20=20{=20dg-do=20compile=20}=0A+=0A+procedure=20= Sync_Tag_Discriminals=20is=0A+=20=20=20=0A+=20=20=20package=20Ifaces=20= is=0A+=20=20=20=20=20=20=0A+=20=20=20=20=20=20type=20Test_Interface=20is=20= limited=20interface;=0A+=20=20=20=20=20=20=0A+=20=20=20=20=20=20= procedure=20Interface_Action=20(Test:=20in=20out=20Test_Interface)=20is=20= abstract;=0A+=20=20=20=20=20=20=0A+=20=20=20end=20Ifaces;=0A+=20=20=20=0A= +=20=20=20=0A+=20=20=20package=20Implementation=20is=0A+=20=20=20=20=20=20= type=20Test_Implementation=0A+=20=20=20=20=20=20=20=20(Constraint:=20= Positive)=20is=0A+=20=20=20=20=20=20=20=20synchronized=20new=20= Ifaces.Test_Interface=20with=20private;=0A+=20=20=20=20=20=20=0A+=20=20=20= private=0A+=20=20=20=20=20=20protected=20type=20Test_Implementation=0A+=20= =20=20=20=20=20=20=20(Constraint:=20Positive)=0A+=20=20=20=20=20=20is=20= new=20Ifaces.Test_Interface=20with=0A+=20=20=20=20=20=20=0A+=20=20=20=20=20= =20=20=20=20overriding=20procedure=20Interface_Action;=0A+=20=20=20=20=20= =20=20=20=20=0A+=20=20=20=20=20=20end=20Test_Implementation;=0A+=20=20=20= end=20Implementation;=0A+=20=20=20=0A+=20=20=20package=20body=20= Implementation=20is=0A+=20=20=20=20=20=20protected=20body=20= Test_Implementation=20is=0A+=20=20=20=20=20=20=20=20=20procedure=20= Interface_Action=20is=20null;=0A+=20=20=20=20=20=20end;=0A+=20=20=20end=20= Implementation;=0A+=20=20=20=0A+begin=0A+=20=20=20null;=0A+end=20= Sync_Tag_Discriminals;=0Adiff=20--git=20= a/gcc/testsuite/gnat.dg/sync_tag_limited.adb=20= b/gcc/testsuite/gnat.dg/sync_tag_limited.adb=0Anew=20file=20mode=20= 100644=0Aindex=2000000000000..608f10662a3=0A---=20/dev/null=0A+++=20= b/gcc/testsuite/gnat.dg/sync_tag_limited.adb=0A@@=20-0,0=20+1,50=20@@=0A= +--=20=20Synchronized=20tagged=20types=20created=20by=20a=20private=20= extension=20with=20the=20keyword=0A+--=20=20'synchronized'=20shall=20be=20= seen=20as=20an=20(immutably)=20limited=20tagged=20type,=20and=0A+--=20=20= should=20therefore=20accept=20default=20disciminant=20spectifications.=0A= +--=20=20This=20was=20a=20bug=20in=20earlier=20versions=20of=20GNAT,=20= whereby=20GNAT=20erroneously=0A+--=20=20relied=20on=20a=20parent=20= synchronized=20interface=20to=20determine=20limitedness=0A+--=20=20of=20= a=20synchronized=20private=20extension.=20The=20problem=20being=20that=20= a=20synchronized=0A+--=20=20private=20extension=20can=20derive=20a=20= non-synchronized=20interface=20(specifically=20a=0A+--=20=20limited=20= interface),=20Yet=20the=20RM=20makes=20it=20clear=20(7.3(6/2))=20that=20= such=0A+--=20=20synchronized=20private=20extensions=20are=20always=20= limited.=0A+--=0A+--=20=20Ergo:=20Default=20discriminants=20are=20of=20= course=20legal=20on=20any=20synchronized=20private=0A+--=20=20extension.=0A= +=0A+--=20=20{=20dg-do=20compile=20}=0A+=0A+procedure=20Sync_Tag_Limited=20= is=0A+=20=20=20=0A+=20=20=20package=20Ifaces=20is=0A+=20=20=20=20=20=20=0A= +=20=20=20=20=20=20type=20Test_Interface=20is=20limited=20interface;=0A+=20= =20=20=20=20=20=0A+=20=20=20=20=20=20procedure=20Interface_Action=20= (Test:=20in=20out=20Test_Interface)=20is=20abstract;=0A+=20=20=20=20=20=20= =0A+=20=20=20end=20Ifaces;=0A+=20=20=20=0A+=20=20=20=0A+=20=20=20package=20= Implementation=20is=0A+=20=20=20=20=20=20type=20Test_Implementation=0A+=20= =20=20=20=20=20=20=20(Constraint:=20Positive=20:=3D=201)=20is=0A+=20=20=20= =20=20=20=20=20synchronized=20new=20Ifaces.Test_Interface=20with=20= private;=0A+=20=20=20=20=20=20=0A+=20=20=20private=0A+=20=20=20=20=20=20= protected=20type=20Test_Implementation=0A+=20=20=20=20=20=20=20=20= (Constraint:=20Positive=20:=3D=201)=0A+=20=20=20=20=20=20is=20new=20= Ifaces.Test_Interface=20with=0A+=20=20=20=20=20=20=0A+=20=20=20=20=20=20=20= =20=20overriding=20procedure=20Interface_Action;=0A+=20=20=20=20=20=20=20= =20=20=0A+=20=20=20=20=20=20end=20Test_Implementation;=0A+=20=20=20end=20= Implementation;=0A+=20=20=20=0A+=20=20=20package=20body=20Implementation=20= is=0A+=20=20=20=20=20=20protected=20body=20Test_Implementation=20is=0A+=20= =20=20=20=20=20=20=20=20procedure=20Interface_Action=20is=20null;=0A+=20=20= =20=20=20=20end;=0A+=20=20=20end=20Implementation;=0A+=20=20=20=0A+begin=0A= +=20=20=20null;=0A+end=20Sync_Tag_Limited;=0A--=20=0A2.40.1=0A=0A= --Apple-Mail=_A4A5E29D-55A4-4DDF-AD0C-749B04BFD347 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Sep 1, 2023, at 08:08, Arnaud Charlet wrote: >=20 >> For some reason, your email is endeing up in a strange format, I = almost >> missed the .patch file attached, making the review harder. >=20 > Never mind, I was on vacation earlier this month and then busy with a = seminar last week, so I started looking at your ping email before the = original email which did contain the patch easily found, sorry for the = noise! >=20 > Arno --Apple-Mail=_A4A5E29D-55A4-4DDF-AD0C-749B04BFD347--