From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id ADCFB3858296; Thu, 24 Nov 2022 10:12:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADCFB3858296 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669284741; bh=Bls3+3EsxbzDfsLeJQ3ByxgxoVj18CdNfbu6VOVCi7o=; h=From:To:Subject:Date:From; b=NMtZK3L/7ddQE9WszXP3TY/e0Fhnqo4yBztNayZsZLNtpu9cH7kY4uR8dQYylkub0 7mOrOSe6q5pfWfHPAUVQ91oufHqdMPM4gmf+CXM/oktUajma+pi6HQiceHCGiMt+Ok lxHEuVM2jIBr2Q3WgziNzjJyVF5H5fJ+Vosn3MvY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4288] ada: Add assertion for the implementation of storage models X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: af94026524eafbe1270e28e5142e5958a4dadf07 X-Git-Newrev: 7f77aa6b2f04781faa78373add11538d276c8ae4 Message-Id: <20221124101221.ADCFB3858296@sourceware.org> Date: Thu, 24 Nov 2022 10:12:21 +0000 (GMT) List-Id: https://gcc.gnu.org/g:7f77aa6b2f04781faa78373add11538d276c8ae4 commit r13-4288-g7f77aa6b2f04781faa78373add11538d276c8ae4 Author: Eric Botcazou Date: Tue Nov 22 13:03:00 2022 +0100 ada: Add assertion for the implementation of storage models 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. Diff: --- 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