From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nh605-vm7.bullet.mail.ssk.yahoo.co.jp (nh605-vm7.bullet.mail.ssk.yahoo.co.jp [182.22.90.80]) by sourceware.org (Postfix) with SMTP id 79D813857B8C for ; Fri, 8 Jul 2022 00:07:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79D813857B8C Received: from [182.22.66.103] by nh605.bullet.mail.ssk.yahoo.co.jp with NNFMP; 08 Jul 2022 00:07:00 -0000 Received: from [182.22.91.132] by t601.bullet.mail.ssk.yahoo.co.jp with NNFMP; 08 Jul 2022 00:07:00 -0000 Received: from [127.0.0.1] by omp605.mail.ssk.yahoo.co.jp with NNFMP; 08 Jul 2022 00:07:00 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 638584.94633.bm@omp605.mail.ssk.yahoo.co.jp Received: (qmail 80651 invoked by alias); 8 Jul 2022 00:07:00 -0000 Received: from unknown (HELO ?192.168.2.4?) (175.177.45.168 with ) by smtp6002.mail.ssk.ynwp.yahoo.co.jp with SMTP; 8 Jul 2022 00:07:00 -0000 X-YMail-JAS: Gj_V5.4VM1nRmkAh0STU39sKiPuP6_lc8rF_haJ7MFC8wpwUO0QTFYEO3TrsS8SB_2iAvZMJF8skbjTgQ4s_o7N92zXhjVTpVGt0_iVJT3LeCdJzJiSvGtWSWwwHfYTNqbuXcU2SuA-- X-Apparently-From: X-YMail-OSG: Cw2odAAVM1lkZub1BEXUYUmwaDDQQRiozLThrzWFy2BuOgL p07Q0PGZCJuTXjB2K9iv2Z7xvkarBvbZkT0Y72Z2esYTMJpOvsUoEkF2dfWg frntB7CEyP_rMO9BTwhDEE8jOTg8BYvpJZXPuQAKoUBRzni1JkWS4pdjFYc3 fvDWsA_q3JaDYN6TH6UMMXqXr2roFoUrYYB92fTEugTzmD8XVPoMbVCVeRsn MmQiYvnI8SFN5G7b5Ty4PnccZlQLgaWRDd_KiYx97fGz2LpmtywGPkBG8MkV vTDBkeLZ6rsOxwsqqtEBxuSCqTei2xu7v8jaGnVic3TdFM0_TAz9EFfIxUc8 BLi1XAkuI8Zyk73S76GSrxmDlGc9F8F6ZhN8H8JhFqKLsBixQ6odDjMrjSEE 177vMHXCSUk3w_apU_G_sNeVQhXewm5n.yuyMQBbm3Jajg2hJMEhbU.xgiPM NUcOAO2cknAu5_.pdc2agAoT3_thGIAPPQ4qZqpvTPlNy6EopbsFFNefI6HD XCN0YCh9jpBLDlDW4lFAQGtr1Rdsd7xbM2Dic8EEe_VoZIwSiD2ouwX_uQGd zfITWURwa2mXkdEKWslEsoHLL8aL1eX2kk0m5YaT1tNTWiLaBEAEtnPjCBF. _YV3r8xXULwxwOMtQ_MyozxtgmDLJMafmTkn1TnXiForkHtzQcE44IhtaKeo 8qURss.Xrpvi41WWz4jO8q5xwbc7ytkUf50oehD_j0_thDjB733yJgVITjpw ItUA.4ymu0RmUn67Lmqe8cFFE8744oJG_jAJNUbWeSNie7VBJpdsIh_RVd.M bMr4ljVtt01ALhLBxEYvOdXGRrJhQVxACjknXpFR99tM5TtooU5XtI2Z.h0w EOmeY.SFluPZECqE3bMQfNi49HK9XAbQxdGOgx7xlPcvcEu466_CE597A5.F sEOGqqL52X9Zg Message-ID: Date: Fri, 8 Jul 2022 09:06:59 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.1 Subject: Re: [RFA] Improve initialization of objects when the initializer has trailing zeros. Content-Language: en-US To: Jeff Law References: <446ea3de-5486-8756-47f1-7822d79c5d75@gmail.com> Cc: GCC Patches From: Takayuki 'January June' Suwa In-Reply-To: <446ea3de-5486-8756-47f1-7822d79c5d75@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KAM_SHORT, NICE_REPLY_A, 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 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-List-Received-Date: Fri, 08 Jul 2022 00:07:06 -0000 On 2022/07/07 23:46, Jeff Law wrote: > This is an update to a patch originally posted by Takayuki Suwa a few months ago. > > When we initialize an array from a STRING_CST we perform the initialization in two steps.  The first step copies the STRING_CST to the destination.  The second step uses clear_storage to initialize storage in the array beyond TREE_STRING_LENGTH of the initializer. > > Takayuki's patch added a special case when the STRING_CST itself was all zeros which would avoid the copy from the STRING_CST and instead do all the initialization via clear_storage which is clearly more runtime efficient. Thank you for understanding what I mean... > Richie had the suggestion that instead of special casing when the entire STRING_CST was NULs  to instead identify when the tail of the STRING_CST was NULs.   That's more general and handles Takayuki's case as well. and offering good explanation. > Bootstrapped and regression tested on x86_64-linux-gnu.  Given I rewrote Takayuki's patch I think it needs someone else to review rather than self-approving. LGTM and of course it resolves the beginning of the first place (https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595685.html). > > OK for the trunk? > > Jeff >