From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 75DED3858D37 for ; Fri, 1 Sep 2023 12:06:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75DED3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31c93d2a24fso1513762f8f.2 for ; Fri, 01 Sep 2023 05:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1693569963; x=1694174763; darn=gcc.gnu.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=QPmk+GG5LoxV5NGbeJDqJx1ccD1bCVy0b0SifRGE7RQ=; b=ZBL6NP3539zrPiXu/ZXJQ8zUnEgy8pS7U47Lxqlyjp+mgzu6DXxbHK2dxkY+uj3wfW 4ZuBBU9YJwxee+Q0QHpvijWkFjC8HgM4FQIZaay56BMSELi5utlh3+KVvFHoXVQqW7NP c30qZj5MJkFiYKoBoJgm7NzWG++o9rpoXGiSRNHDiKYjeN5yLn5qx3mkxjLUxhlfJhnJ 9vgaiExW7J9zuCMDXGuF5dV7kqLcahg52EKgQb1/P432j9c2Kk4Mq6oZGzCEzQABQQDJ pI6VCBg4MEOVXorZMLIr08VYQjUtuaKthrX7ERGmhe3pupwBfgHJyxwyv/xX6lZ7DEFw DmwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693569963; x=1694174763; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QPmk+GG5LoxV5NGbeJDqJx1ccD1bCVy0b0SifRGE7RQ=; b=IApWqDmtE9LtzDC8ojZ6mgdLxTrTYWe2jyHUHo5aJkY5x19gW0HrAwghb4rggW9Uyr sihbnjE1lA79ysyCbePiP6YT1VKxjYyl/FB903GAuANJopZ+yHOxYq5vQCgi0n3bmvBE mL7rN1zKSy9Z+XhP17UTm9PHstmUbyDmoUfF/o25qJ/0BCOUmA1y9pyrQLj4SMsDMzcf tRsvNSAD5CEhPNvmCuQ8gKxWlqlmRLRaBINaSgn8k45rbTRL67UTpwpOUKiqVsDfPThd vHH6dLymPXK8RXjjrllAyBGDNRJdN7jxYjmtGRwgeFKlyzGjyBCHMKFz4e584FTD96Jl Ynew== X-Gm-Message-State: AOJu0Yy1iDMWY6Jc8f1sM1PGdZitY1psHlPTibQHIJ747s8rJpXIRTsn HYuBKe1/t0hZ+SqwZFA7h/KJlg== X-Google-Smtp-Source: AGHT+IFSYfXbSxmpkkR4cgEmEQbBUhFMPJ80asfvQrv9B1fDHIPuHE+iatqCtZnlPIKWuRgm/G8kAQ== X-Received: by 2002:a5d:4082:0:b0:313:e456:e64a with SMTP id o2-20020a5d4082000000b00313e456e64amr1731556wrp.21.1693569962935; Fri, 01 Sep 2023 05:06:02 -0700 (PDT) Received: from localhost ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id p22-20020a1c7416000000b003fe23b10fdfsm7883742wmc.36.2023.09.01.05.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Sep 2023 05:06:02 -0700 (PDT) Date: Fri, 1 Sep 2023 12:06:02 +0000 From: Arnaud Charlet To: Richard Wai Cc: gcc-patches@gcc.gnu.org, 'Eric Botcazou' , 'Arnaud Charlet' , 'Stephen Baird' Subject: Re: [PING][PATCH 1/2] Ada: Synchronized private extensions are always limited Message-ID: <20230901120602.GA1852336@adacore.com> References: <010d018a22c6e28b-dec61310-ac9d-44db-ab50-f08bedcd2ebe-000000@ca-central-1.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <010d018a22c6e28b-dec61310-ac9d-44db-ab50-f08bedcd2ebe-000000@ca-central-1.amazonses.com> X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: Richard, For some reason, your email is endeing up in a strange format, I almost missed the .patch file attached, making the review harder. There's a typo in the comment added: + -- explicit limitedness implied by a synchronized private extension + -- the does not derive from a synchronized interface (see RM-7.3(6/2)). the -> that does not derive... OK with this change. > From: Richard Wai > Sent: Thursday, August 10, 2023 12:55 AM > To: 'gcc-patches@gcc.gnu.org' > Cc: 'Eric Botcazou' ; 'Arnaud Charlet' > ; 'Stephen Baird' > Subject: [PATCH 1/2] Ada: Synchronized private extensions are always limited > > > > GNAT currently considers a synchronized private extension that derives from > an interface to be limited only when said interface is a concurrent > interface. However it is of course legal for a synchronized private > extension to derive from a limited interface. In this case GNAT fails to > correctly determine that the private extension is limited. > > > > This causes two separate problems that makes discriminated types in such a > case impossible: > > 1. GNAT inappropriately rejects compilation, claiming default > discriminants on such a private extension are illegal. > 2. GNAT fails to generate the expected discriminals for the > unconstrained discriminanted case, leading to the corresponding > discriminants of the "corresponding record" of the underlying concurrent > type to have no identifiers, and thus compilation fails. > > > > Fairly simple fix. If "synchronized" appears in the private extension > declaration, it is limited. This is explicit in the RM as well (7.3(6/2)). > > > > Fixing this bug uncovered of a related bug wrt. TSS address finalizer > generation for constrained subtypes of synchronized private extensions with > no default discriminants. That patch is to follow separately. > > > > Patch file is attached. > > > > -- Begin change log entry -- > > > > ada: Private extensions with the keyword "synchronized" are always limited. > > > > GNAT was relying on synchronized private type extensions deriving from a > concurrent interface to determine its limitedness. This does not cover the > case where such an extension derives a limited interface. RM-7.6(6/2) makes > is clear that "synchronized" in a private extension implies the derived type > is limited. GNAT should explicitly check for the presence of "synchronized" > in a private extension declaration, and it should have the same effect as > the presence of "limited". > > > > gcc/ada/ > > * sem_ch3.adb (Build_Derived_Record_Type): Treat presence of > keyword "synchronized" the same as "limited" when determining if a private > extension is limited. > > > -- End change log entry -- > > > This patch was bootstrapped on x86_64-*-freebsd13.2. Two new test cases were > added. Note that 4 gnat test cases fail currently on master and are > unrelated to this patch.