From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 280163858433 for ; Mon, 15 Nov 2021 19:17:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 280163858433 Received: by mail-pl1-x633.google.com with SMTP id m24so5321832pls.10 for ; Mon, 15 Nov 2021 11:17:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=OGHKlxgzOyolf6zv58uyrBrZEOcwJDpOC28xTHPCrtQ=; b=zShCzKkOlfrrNBxjuij3oeLlOtdnhaqqfWkBZuapIvmHZ2//6aCIt5CLRel8QmDChf sE4ThOYCxjFAvctySqcUs5mA4w0yQSlcVCVcSl4+Ru3enxlOwALMGmvQJ9RvDob18ped 3RJGff6kVKJ9rf984Kp/I9++qk+VQBi5Ps0OFEjpq95cyPMsDYv0zBHfY5Mx58M4XA2N qi2ffuWGa7kcL6ty8Wp6CE/lz8f+ziHCRwaeDRYB5lIVh32vkku9zrULTW7q2/iUHH1W rfeWZRvNDFdPl0czcU191MtiGA9G9cDA8c+45kvnOauqTEuzt7qMtTeS10WhW0PPHnsg UGIg== X-Gm-Message-State: AOAM532jwaXnteSny1fHvbp3tlko3rXDSDa8nFuThz9w48dithk0daWv qNhy+QUI+N2oKD93teo07dBUscJOyOw= X-Google-Smtp-Source: ABdhPJw+uyGTCJmYSQjOLA7G+EJH75kOzYIK38A7Ht4Xhyi2IAvbdDd5MLQYWOf5lZqLe33YLPA6fg== X-Received: by 2002:a17:90a:be0f:: with SMTP id a15mr1026551pjs.243.1637003831307; Mon, 15 Nov 2021 11:17:11 -0800 (PST) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id t8sm13126278pgk.66.2021.11.15.11.17.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Nov 2021 11:17:11 -0800 (PST) Message-ID: Date: Mon, 15 Nov 2021 12:17:10 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v2 1/3] gimple-fold: Transform stp*cpy_chk to str*cpy directly Content-Language: en-US To: Siddhesh Poyarekar , gcc-patches@gcc.gnu.org References: <20211111194116.1626980-1-siddhesh@gotplt.org> <20211115173315.1857598-1-siddhesh@gotplt.org> <20211115173315.1857598-2-siddhesh@gotplt.org> From: Jeff Law In-Reply-To: <20211115173315.1857598-2-siddhesh@gotplt.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 15 Nov 2021 19:17:13 -0000 On 11/15/2021 10:33 AM, Siddhesh Poyarekar wrote: > Avoid going through another folding cycle and use the ignore flag to > directly transform BUILT_IN_STPCPY_CHK to BUILT_IN_STRCPY when set, > likewise for BUILT_IN_STPNCPY_CHK to BUILT_IN_STPNCPY. > > Dump the transformation in dump_file so that we can verify in tests that > the direct transformation actually happened. > > gcc/ChangeLog: > > * gimple-fold.c (dump_transformation): New function. > (gimple_fold_builtin_stxcpy_chk, > gimple_fold_builtin_stxncpy_chk): Use it. Simplify to > BUILT_IN_STRNCPY if return value is not used. > > gcc/testsuite/ChangeLog: > > * gcc.dg/fold-stringops.c: New test. OK jeff