[COMMITTED,27/35] ada: Fix internal error on bit-packed array type with Volatile_Full_Access
Message ID | 20241025091107.485741-27-poulhies@adacore.com |
---|---|
State | Committed |
Commit | de8d6829371821775183fbf5633cc1e654d96b78 |
Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D11573857C5D for <patchwork@sourceware.org>; Fri, 25 Oct 2024 09:19:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id DF15E3858C50 for <gcc-patches@gcc.gnu.org>; Fri, 25 Oct 2024 09:11:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF15E3858C50 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 DF15E3858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729847527; cv=none; b=tYc3faJ8ZgRmK1/fjfaRcagBN+8AAbD1hOUQTbMEnCtBrNjZCjiwtj14wvC24ZQYKCeHRO4IgrQqYdL5k/X9A0m3VltAKsuDF2c6WdlE1RcNnLQ5a8W1zeu5mM9xxM3bMYdjzxFQapP8D8l08ocdTdRTVWw0nJ2Z8A7x2pvNE6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729847527; c=relaxed/simple; bh=Pkslyyl4NggSKNIbslZUf7Lf1pif354n0+GbkDB69DI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jXWYPQyL21nRYYTUWaT6iwAsZNN3cd9BPdvVrobmgC2H0g929/hqMVNJN4/wBuXNNZW0ZEFLIhmwIAx3vcPWSMFaItxgWVdsfJC2GdMOxR2xYfjmpro1WDgpbHIXJLpU5Lm02hwIrkaGjtsIoZCB4DOxhKouevXGc3y6tSH+1CA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4315baa51d8so18499665e9.0 for <gcc-patches@gcc.gnu.org>; Fri, 25 Oct 2024 02:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1729847511; x=1730452311; 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=Sm++Wb6K4ArVnY7y7YiBkxJ53692jwCqIXZMGqFpdm4=; b=TbHjYJ0e+/OGBIy2e5eZJpWv5uEMDRGIerLJ09S/ta1lE5PPkMMmUH3lbVU+hVRvMz K4creLdnJGrakeA04+2jo90x0u2OBjm3saXSnV4iuCwNEmWjWgBdz91s0GVGRRfIRPAZ GPNW/ee0yrSf59VDhC2m+2GAO0Wmj39q9dOujPbtrh/OViaIl7W/iHUBg8uCr72KMS/s 9SOKt5pn9jSMJ+Yh2SF4cQyEmMt/+957VkZ87NfWWVotULK/yNc52FcDIUo0q9mcMX8k +vKHiZKn6KSA6t2CKeK7qchC/E0PwBKCA63q0IiujXC15EmuN1Qj6kjbQW9yS8NgutSf 5xBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729847511; x=1730452311; 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=Sm++Wb6K4ArVnY7y7YiBkxJ53692jwCqIXZMGqFpdm4=; b=U1C0tIBthIB15e1fikVBHR5EuQNCa016pq/yuk71YSHXGLFx2R8N5Q2pLFkyPxO7YP ZgIqM31wIuor4/6TnX+IGD1gdpuAJXCrZXelKs9XamuNGIoa344uXgC21Ba2T3JR+jfa gCgv3c0dl+rg3WR+ubH0iEwqAPCzRhCiW415o5S9HxSpcL2jHVSkajeNcwJehq0L4b52 NyzE2XniemCKEFK4fe4VOH/aqH6pBStXqhzSj2kQrt1o8jVQ9SC5ckgtgV3jP7shrNFg 3PZVGI2p3AB7eKibeHifFkfq1F3yVBrAaQ8DHWguLw1VMqFsrP6KzxWg8B1K0YPk68eJ BGkg== X-Gm-Message-State: AOJu0YyJ0/jFjMRn+v0dITCXCbbudaf3/3nazuk/PrbQkZ53NY+CngtJ uJZdBp/XzpshNP7fzqDlVTCd2cEssohP9Wd4IkUSH3DksiSGOQKbilW6ICAgk0eYpPCE58UCSb0 = X-Google-Smtp-Source: AGHT+IGlUlaDUeoRfbrjG5X72JMXP6g6T94Ed6EnBRqMsptAFaKWyfszsTTlE/2gB49gBXdkWKj0Kw== X-Received: by 2002:a05:6000:4598:b0:37d:5231:f539 with SMTP id ffacd0b85a97d-37efcf8af56mr5057043f8f.54.1729847511625; Fri, 25 Oct 2024 02:11:51 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:2626:b78c:6271:6c01]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38058b47aa8sm1013079f8f.51.2024.10.25.02.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 02:11:51 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou <ebotcazou@adacore.com> Subject: [COMMITTED 27/35] ada: Fix internal error on bit-packed array type with Volatile_Full_Access Date: Fri, 25 Oct 2024 11:10:56 +0200 Message-ID: <20241025091107.485741-27-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241025091107.485741-1-poulhies@adacore.com> References: <20241025091107.485741-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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
Series |
[COMMITTED,01/35] ada: Pass parameters of full access unconstrained array types by copy in calls
|
|
Commit Message
Marc Poulhiès
Oct. 25, 2024, 9:10 a.m. UTC
From: Eric Botcazou <ebotcazou@adacore.com>
The problem occurs when the component type is a record type with default
values for the initialization procedure of the (base) array type, because
the compiler is trying to generate a full access for a parameter of the
base array type, which does not make sense.
gcc/ada/ChangeLog:
PR ada/116551
* gcc-interface/trans.cc (node_is_atomic) <N_Identifier>: Return
false if the type of the entity is an unconstrained array type.
(node_is_volatile_full_access) <N_Identifier>: Likewise.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/gcc-interface/trans.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index 7728e60ccb6..93f67404ddb 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -4263,7 +4263,10 @@ node_is_atomic (Node_Id gnat_node) if (!Is_Object (gnat_entity)) break; return Is_Atomic (gnat_entity) + /* Disregard the flag on unconstrained arrays or simple constants + since we cannot or need not generate an atomic access. */ || (Is_Atomic (Etype (gnat_entity)) + && Ekind (Etype (gnat_entity)) != E_Array_Type && !simple_constant_p (gnat_entity)); case N_Selected_Component: @@ -4303,7 +4306,10 @@ node_is_volatile_full_access (Node_Id gnat_node) if (!Is_Object (gnat_entity)) break; return Is_Volatile_Full_Access (gnat_entity) + /* Disregard the flag on unconstrained arrays or simple constants + since we cannot or need not generate a full access. */ || (Is_Volatile_Full_Access (Etype (gnat_entity)) + && Ekind (Etype (gnat_entity)) != E_Array_Type && !simple_constant_p (gnat_entity)); case N_Selected_Component: