From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 29A273882060 for ; Thu, 13 Jun 2024 13:33:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29A273882060 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 29A273882060 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718285639; cv=none; b=IFBtuW8rg46AA8qAVBmHkl3ZvrmIXW1alkmaqjjKWISajbHgT+r96Hj4+mZQQLnchW/f47WewxHZi4JS46NxRrqeriC28CaGWLgsZeNDwFo2auNXpCm/nuU2oWi3i6IzZXtyCWoJHI39YzXF3J2yJKrK8alSxwowliDmiwGhoZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718285639; c=relaxed/simple; bh=CmrJLGdI42voCs/tf44tCVwBefgU4p9mGNHwE24yyPo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=iIkkSQjiMzXs5X0WHElxrWyho37uBR8djq1b4PVM/Ng+dybz9gLEfNTzmZR4WcWyl4L7spQhU2u4ggGs8Ouhw6VZ2FTgddRF+WYFz3RTV+PADx7cxT+3Bt41vDoCH4MAZtJSdDzwq+JhCzTR/mHExWlhPAD8qcygY4Nlo8K9LpI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42281d8cd2dso7722225e9.3 for ; Thu, 13 Jun 2024 06:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718285636; x=1718890436; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z5HoDjd1lvzKjoSGxF5EZPrwxbnX7HTmiy6+/xoFtJA=; b=PumTSsJqCNOwkBoKNj2LukuipVNJoRGUYfGlszms3q+SO4nrYhOVe8SyWQiraVDB/t sjxaVnDPlIN8UaThfrB9iDNNOhYJK3YiRwR9YC8FfOYVa6bHoVlEznH9/sRM2PmSiqI/ U2zGLZb/mEDI16b30oPfQqaJbG5sRvDP/sn8UuTqP5isxpXzwDAmNA4bO7Gg4OclYS+8 BnapJj8IqFAmUaaQthUDuY6darc6egMKM/45UJp8N2MXOHxAdOvgOD5jMOb6PnBryIAh BnaDta1pB1VbBcxW2l/tfMXNSJMB0Qbza3SNCU+0pH0ix4hiMPrfdwdKr0aauUZCt9Zu 6uHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718285636; x=1718890436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z5HoDjd1lvzKjoSGxF5EZPrwxbnX7HTmiy6+/xoFtJA=; b=SDijXOA2PkMcIFT0iiTvDXpTfWKClhxB9S9LRNFwRVwayyAS/JAMMckcMwIByJ53ZH Tmy6fu42wHWBSCRyzcZh+i69f9Ew8Ub4ZY2nLIcii/4PKjSoT3wvhmD3j1KA0zfRMbtx 8C7QuNUvvClgRyKlbVfA3dUswKXqcqeXpRzFV8+Nae3RkGKFKOsJIZMBZKTGbmg/iUSA ylWQCp/IyO+l235WI37tW/8dtuSWUnJQid0VVbqXJmTWOgDv08t2tEjFpIyf7nZAklre SLu4Iwl+FyePBRH1UxwCB8Ljm2G5HY2dRlu7mQU4Ktx6Th8/vRa1T/gr+bh1PQDzN7WC 3ZfA== X-Gm-Message-State: AOJu0YyQYF7j/ci2nd7zA3OQ8tuRXkf1Av14CIGiW4TdKZ6iH0CQ01HP +JbywFKEvZxJH6X36uU+hyHbTaWtrzmScTdldpM1C8Uj0m9Sw9kwMICSeR4iYF1Dmr8DwISrGU8 = X-Google-Smtp-Source: AGHT+IGqLkjmVtXVeF8ooyTJS0F8ttdIzBVWHCbC2GnbfYcwLvPX7CzPFZWJi9OUxQzjH/0bzjAopA== X-Received: by 2002:a05:600c:1c15:b0:422:7467:963d with SMTP id 5b1f17b1804b1-422863ad387mr37683285e9.21.1718285635892; Thu, 13 Jun 2024 06:33:55 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422870e9145sm62391955e9.22.2024.06.13.06.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 06:33:55 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Steve Baird Subject: [COMMITTED 08/30] ada: Reject too-strict alignment specifications. Date: Thu, 13 Jun 2024 15:33:14 +0200 Message-ID: <20240613133338.1809385-8-poulhies@adacore.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240613133338.1809385-1-poulhies@adacore.com> References: <20240613133338.1809385-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: From: Steve Baird In some cases the compiler incorrectly concludes that a package body is required for a package specification that includes the implicit declaration of one or more inherited subprograms for an explicitly declared derived type. Spurious error messages (e.g., "cannot generate code for file") may result. gcc/ada/ * sem_ch7.adb (Requires_Completion_In_Body): Modify the Comes_From_Source test so that the implicit declaration of an inherited subprogram does not cause an incorrect result of True. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch7.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 09d85bea335..0f0fc90ad6b 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -2827,13 +2827,14 @@ package body Sem_Ch7 is -- Otherwise test to see if entity requires a completion. Note that -- subprogram entities whose declaration does not come from source are -- ignored here on the basis that we assume the expander will provide an - -- implicit completion at some point. + -- implicit completion at some point. In particular, an inherited + -- subprogram of a derived type should not cause us to return True here. elsif (Is_Overloadable (Id) and then Ekind (Id) not in E_Enumeration_Literal | E_Operator and then not Is_Abstract_Subprogram (Id) and then not Has_Completion (Id) - and then Comes_From_Source (Parent (Id))) + and then Comes_From_Source (Id)) or else (Ekind (Id) = E_Package -- 2.45.1