From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7879) id 8E1E83858433; Wed, 15 Feb 2023 10:23:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E1E83858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676456634; bh=bCkutCD8XbCQAbz1mTD4+C5TJXo5YKZhpdhWBbJpV0U=; h=From:To:Subject:Date:From; b=QWVTCTavoMi2xYbMNZ9iz7TE4qiC6V59667n8aB4gJn0vlscxWNaC1xjmoB0Jjyh2 d0YnVcIG2Xf4ihVWxx11KWlIguEvbgiIKWQYjhrmQg0TBbAvLGnRVegflR27nwxFWg jLM8hYrCPuZ/MBM1OvrQPm8DQZKFSwBqlxtO4lCM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Filip Kastl To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/pheeck/heads/sccp)] ada: Add assertion for the implementation of storage models X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/users/pheeck/heads/sccp X-Git-Oldrev: c97653922443d7fd5cc08e294ee55782789af0c1 X-Git-Newrev: 1d8296fbdb68134ce11884716bcf1d9b9abcd565 Message-Id: <20230215102354.8E1E83858433@sourceware.org> Date: Wed, 15 Feb 2023 10:23:54 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1d8296fbdb68134ce11884716bcf1d9b9abcd565 commit 1d8296fbdb68134ce11884716bcf1d9b9abcd565 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