From patchwork Thu Nov 24 10:12:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 25421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3302385wrr; Thu, 24 Nov 2022 02:14:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5hugGsLEEjEqSPfpEUsfh40bfd5KCEeEKfJvK/n4bTYoJ7V2V7pyT6isNVAfbTpD5H+xTJ X-Received: by 2002:a17:906:9518:b0:7ad:b152:6bd1 with SMTP id u24-20020a170906951800b007adb1526bd1mr17797043ejx.30.1669284873031; Thu, 24 Nov 2022 02:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669284873; cv=none; d=google.com; s=arc-20160816; b=efIYSMHlYoPSztr19wz20IFwzEhKzGQaucGboN4fZiJJ2oDV79tP6q8myBOCqhPFvI iaZ/62Ayxzmxaf5E/uDesyyCYAzdy2tiYtD+Ca387mT6/4u7a2x64EsttBjNboqRPGXE Lr0Quq6UkFoolPGt0DLZ7caNIHoZFE+IXQaHsyJnoSAhHI0rZdgZWl6BzRRHeQvuKTvC v3sUfI4/JzWCrXhD1SYdzf94YZ/B9/RHNezMZkyyOhAYsb2HaV2VlXBpjzX8lU3QG19R ISToseJF/KB/KtgcmKzFCLbykJZwwns56ZqMxFuX59JaZ1g9S88+YvghMuGLA3nxkTAC xobw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=IuQesOJny4iJ7vdRSspIKpylxc7PfY31neOXFsw6/CE=; b=IeaCDPyz8qbc7a7mEglHECck0Y+uYdaHxBHvsuiKF1ILCam0UU64h+UoXu4fLWAfLD l9ByljB3SrxZt+2yS1rEHQ7vQX6weyVyu31n/hXaK7LKVhkjKqp8e89oKMPch/oACwEQ 0u4ZGTQ/HPcbyz5YNUYAVxzZunKOLZfIqY7PGgal5V2R1M1Kh9p3PgsyzEhmrBUBFYuL +KCRMXKpmLYhpT2qVeTpiynrk9jSj6M7L30EJrfUPSn9xF/2Q72C/BhsC8afVwP0brk0 efyXw4Gj9y8I5VvphOvvBn6MygOkmf31seAi4A+o59zatLV6owfrkrtn2LUaMCB6qHUK d1og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sJQw9bhv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w24-20020a170906b19800b007add0c2ee2csi436766ejy.924.2022.11.24.02.14.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 02:14:33 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sJQw9bhv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 14745384F034 for ; Thu, 24 Nov 2022 10:14:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14745384F034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669284872; bh=IuQesOJny4iJ7vdRSspIKpylxc7PfY31neOXFsw6/CE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=sJQw9bhvDQmVMdiGWhFZtwP7O/DgdKgmXQbqp5GueXfNRyU6NlQsI4fTRgc5X2w/1 W/AAzfKzaiFFj/wmevXly06tvht2d5BtbGqgWosIEWioDzrZe2lCdmlOecN4iKJp+n NcpSI+zkYXHGFDyzz8ormxMw0LyWHzIv9tMhH7uw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 2784E38432E9 for ; Thu, 24 Nov 2022 10:13:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2784E38432E9 Received: by mail-wr1-x430.google.com with SMTP id b12so1781404wrn.2 for ; Thu, 24 Nov 2022 02:13:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IuQesOJny4iJ7vdRSspIKpylxc7PfY31neOXFsw6/CE=; b=OnXyKzGwfSwDTys9hODwzAvWl6qTV2tIeP847L+QRZnT/qvGT/n1xJV71r4GwP7Pn5 nPCuF0OOfZ4EpRaMjEtVhXEA4/0/07sYoMkVxkpgFtUNRjQQ5UvEJxYFFZ+wLjS/Lx10 xcNCyNTKZF9nOz6/GfPnkj/FXK+ImtW1vvWJz76eF9iH2jEGoeejNIX18rSZ8WPshUQy 9XByd2R2/lWKPMC/cvDdXmtUmuivMfYlYO4TZi5i3mE8b/A2VhkLA8n9KJyTG3GRA9SJ CAwfst7M510EVO9GmPOArbGHJczDrN/ceRk2cje0kljq4GNXUG21tfcmCt/yxz+98zp7 jQjQ== X-Gm-Message-State: ANoB5pmvWpbwixjYAXBPAnsAC7AHmjijU+nfwOms/PwayWIe1Bxkws3I 9Z1mG/hEkOHR/ofSv6sfNsdOSZaIAb7zaw== X-Received: by 2002:a5d:564d:0:b0:225:2e65:7440 with SMTP id j13-20020a5d564d000000b002252e657440mr20086569wrw.6.1669284780989; Thu, 24 Nov 2022 02:13:00 -0800 (PST) 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 p15-20020a05600c468f00b003cfaae07f68sm2228440wmo.17.2022.11.24.02.13.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 02:13:00 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Add assertion for the implementation of storage models Date: Thu, 24 Nov 2022 11:12:58 +0100 Message-Id: <20221124101258.445328-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750372055018211869?= X-GMAIL-MSGID: =?utf-8?q?1750372055018211869?= From: Eric Botcazou We cannot generate a call to memset for an aggregate with an Others choice when the target of the assignment has a storage model with Copy_To routine. gcc/ada/ * gcc-interface/trans.cc (gnat_to_gnu) : Add assertion that memset is not supposed to be used when the target has a storage model with Copy_To routine. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/trans.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index 1cd621a9377..b9d7c015a73 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -7450,6 +7450,9 @@ gnat_to_gnu (Node_Id gnat_node) else if (Present (gnat_smo) && Present (Storage_Model_Copy_To (gnat_smo))) { + /* We obviously cannot use memset in this case. */ + gcc_assert (!use_memset_p); + tree t = remove_conversions (gnu_rhs, false); /* If a storage model load is present on the RHS then instantiate