From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by sourceware.org (Postfix) with ESMTPS id B0AFC3858C2C for ; Fri, 8 Jul 2022 07:11:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0AFC3858C2C Received: by mail-qt1-x830.google.com with SMTP id y3so5084182qtv.5 for ; Fri, 08 Jul 2022 00:11:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=986hN4vh/Vh6OneeKxLnQ5bkMQNuV+oafKwzl1n0ARw=; b=seg+n+7286knqwBDut76B62sL6KdPuN009SBu/Yppbxb2ohQ+4mYSlmxWX0mNB2Wkd Yg05KFOiuZWhFqm7fnRP2RuxAecYvDJpCWjmLU+HivmaoY9GrP9pTk7dudutJIxMmt+3 h8qoW7ZcDu5Bo2dj09n2fysUwGHwh4TC6uJ9e8vkSbQis4JNFyDKIfw+wAV2C0j7rIp0 PJDkyWokA5QmeCRGiMDw0s0o8XTfJxVYJSGCueElGpnyPnpAwhtWThXalvnkH0llW1hU lr/MJc6YRFFMHQci2UFi9A1pKIHljnCG4kUIJZC6lSyHr5B/8Mp+w9ceOodP7a08zp97 XzoQ== X-Gm-Message-State: AJIora8rM+n/Eq/mbPXMzCA9t6be/W8qWR44wCF4SMSH3uGQpfanIXFE OlL6AQT/7ZIRu+qGkEuna6bbAmaRtZkWpykYLrI= X-Google-Smtp-Source: AGRyM1stnTeQpX4ozNmwXTKN9pvVObyYbEPBMjdX2ZLUYHOxA+zBtkKwGVB5qzSbngdVjOpj4dLH5M5LG11/P/md22M= X-Received: by 2002:a05:6214:2a84:b0:473:2958:2b02 with SMTP id jr4-20020a0562142a8400b0047329582b02mr1539823qvb.122.1657264307146; Fri, 08 Jul 2022 00:11:47 -0700 (PDT) MIME-Version: 1.0 References: <446ea3de-5486-8756-47f1-7822d79c5d75@gmail.com> In-Reply-To: <446ea3de-5486-8756-47f1-7822d79c5d75@gmail.com> From: Richard Biener Date: Fri, 8 Jul 2022 09:11:36 +0200 Message-ID: Subject: Re: [RFA] Improve initialization of objects when the initializer has trailing zeros. To: Jeff Law Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 07:11:49 -0000 On Thu, Jul 7, 2022 at 4:46 PM Jeff Law via Gcc-patches 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. > > 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. > > 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. > > OK for the trunk? OK. Thanks, Richard. > Jeff >