From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from d208-18.smtp-out.ca-central-1.amazonses.com (d208-18.smtp-out.ca-central-1.amazonses.com [23.249.208.18]) by sourceware.org (Postfix) with ESMTPS id E8D933858C01 for ; Wed, 23 Aug 2023 14:22:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E8D933858C01 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=1692800574; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=q1g1ntCvXw0VRxMJRbE/4FlK5EY+xWZuDC7WgjkHSko=; b=OZmIeXa4+lOKDOJOJ2yC/tKoG3mO7ACafHBwiZqV7xxg1mT5Gr3sB/FxOiO/pWKW eN7Lco+spd4Hip8vLCBDuh93gzTnqvFeYtUZLRnby4+ZTOxp+yCPcP5qryNKyT7zUD1 W+9VL6DzvAe50xDUsmuNP+DGmNb2lbFnBiAlM3e0= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qpcfy54xse57bzmyicqs5kisv46vyagl; d=amazonses.com; t=1692800574; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Feedback-ID; bh=q1g1ntCvXw0VRxMJRbE/4FlK5EY+xWZuDC7WgjkHSko=; b=d1NuzaGJrhzad10cC1gcvd1aHWygCPV369haXInmmZdO0d6cTFuOb5APhuw8PCyY nBsp5DYaCM7uTYLA20SYPH5NJBVSLUZHPIKRAwickBlOcPs9HRaAwKBVijzsIurxH8N 8nkcPZYjQ9bNlD3uul5O5WY2q1bLs+3udqt5HB0c= From: Richard Wai To: gcc-patches@gcc.gnu.org Cc: 'Eric Botcazou' , 'Arnaud Charlet' , 'Stephen Baird' References: In-Reply-To: Subject: [PING][PATCH 1/2] Ada: Synchronized private extensions are always limited Date: Wed, 23 Aug 2023 14:22:54 +0000 Message-ID: <010d018a22c6e28b-dec61310-ac9d-44db-ab50-f08bedcd2ebe-000000@ca-central-1.amazonses.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005A_01D9D5AB.C6ED61B0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdnVzUn1JgJQiH76S1W9zz/VM7HjEQ== Content-Language: en-ca Feedback-ID: 1.ca-central-1.KKZpW0DP3lOi0JgzUh4V+obZyxLGOx2dpGS8+RWwiDg=:AmazonSES X-SES-Outgoing: 2023.08.23-23.249.208.18 X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DOS_OUTLOOK_TO_MX,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is a multipart message in MIME format. ------=_NextPart_000_005A_01D9D5AB.C6ED61B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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. Check-ada output of this patch: === acats tests === Running chapter a ... Running chapter c2 ... Running chapter c3 ... Running chapter c4 ... Running chapter c5 ... Running chapter c6 ... Running chapter c7 ... Running chapter c8 ... Running chapter c9 ... Running chapter ca ... Running chapter cb ... Running chapter cc ... Running chapter cd ... Running chapter ce ... Running chapter cxa ... Running chapter cxb ... Running chapter cxf ... Running chapter cxg ... Running chapter cxh ... Running chapter cz ... Running chapter d ... Running chapter e ... Running chapter l ... === acats Summary === # of expected passes 2328 # of unexpected failures 0 Native configuration is x86_64-unknown-freebsd13.2 === gnat tests === Schedule of variations: unix Running target unix FAIL: gnat.dg/specs/alignment2.ads (test for warnings, line 14) FAIL: gnat.dg/specs/alignment2.ads (test for warnings, line 20) FAIL: gnat.dg/specs/alignment2.ads (test for warnings, line 38) FAIL: gnat.dg/specs/alignment2.ads (test for warnings, line 42) === gnat Summary === # of expected passes 3402 # of unexpected failures 4 # of expected failures 23 # of unsupported tests 10 gnatmake version 14.0.0 20230809 (experimental) Richard Wai ANNEXI-STRAYLINE ------=_NextPart_000_005A_01D9D5AB.C6ED61B0--