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 1300A3858D37 for ; Wed, 17 Aug 2022 09:52:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1300A3858D37 Received: from [182.22.66.105] by nh605.bullet.mail.ssk.yahoo.co.jp with NNFMP; 17 Aug 2022 09:52:42 -0000 Received: from [182.22.91.205] by t603.bullet.mail.ssk.yahoo.co.jp with NNFMP; 17 Aug 2022 09:52:42 -0000 Received: from [127.0.0.1] by omp608.mail.ssk.yahoo.co.jp with NNFMP; 17 Aug 2022 09:52:42 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 688987.42803.bm@omp608.mail.ssk.yahoo.co.jp Received: (qmail 17664 invoked by alias); 17 Aug 2022 09:52:42 -0000 Received: from unknown (HELO ?192.168.2.3?) (175.177.45.171 with ) by smtp5005.mail.kks.ynwp.yahoo.co.jp with SMTP; 17 Aug 2022 09:52:42 -0000 X-YMail-JAS: UtfWMvMVM1mkUlHXKksO3f.Uc6QmO63mA38kqZvRXhxz8ele.HF2mhzBgtJfnD.4fu5tV2lUujvypzNe5dQO_sQngGlXrsTFimG_hXKWlKPcSY7bekm4mrzP6lJxFOzD9nS7do9N2w-- X-Apparently-From: X-YMail-OSG: 4zDrKjAVM1nI8NZnSfXpNQrzq3vmgthpCXMDLCaCoL94ST9 MoU_d287LKkYH_VF9MwLS5Us4y4uzqIssOeODcIngnskonRKBy6eoKa5DFh1 befj3k6.RH0drlUMXSai1DRIP7GlnPWHUeW4LgZOjZHEzFNN4B7T7LTbio55 QclS2e.pB9PWMNDHPyttwsloC1OoO7n0TRjIR7eSty1Qu2vJgKGfxzL6QoVQ iAwv5Es5zZCsejHNiD01rvRd9QPXQguSOB2.9xKU6Spljjzs24aTFRONYGd. F3LXNsv1GAFIydXOcrMcRc33nI7_8c7uvB7OgIRv0RoDWCCLY1TinOSUlFV9 CnMTxZNKBM8CgzLKMqrD3WbUqWsLlOkGPAvwU_BDkeSaAsaCjRqPlaISK8MS s1luDmMtMtQ_R.K.1ogFz7h21_r6I6XAhw9RJganBL83uPUay93sXkY2X3nK Rppzsuh_kGqnFMOc0GzEwH91EAUpNGhVesfUHmumfMwSuuEFMFNzeX.HcNfe fWjTmhjikjc56oI3HeUVu23y3Rse4yGY5895r3YdEPsu5ZGcd_xk9UUTAW.J gmQLx6uRXiG6OAOJ4Rc_uAFWSqyMbedw8VYpyNZQEOLNDouql4CFPY7bdcPW 50OPKs3caG2G01ssaWBjooghxrMLi.s5JY2Q4_xhzuUPe9DotjVByQZ.HAMH rdDq7FZ7yD.dZWQf1wzDyebz8vA.t6qZZek5TdBI9ItcDOgAcejdiUnfpBt7 JY9.PEPx7og9M6TPB9nv516Ow7XPBfLdooUk13Me3UKRiWcqnceMyWdQmbiy Ck.ayM9MJ26xpPcw5MORVDBiWvgwpLida.8ibUQsURVGLHNu2WcnbPvONCXV Sz5Eo3lMoMUFpQj7Uyq0neXMeozx5iiwkmU1LVyWQCYtjpwNmvzCFTM4e.dI 6NDE3EY_KVZmbCz3WGw-- Message-ID: Date: Wed, 17 Aug 2022 18:51:58 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 From: Takayuki 'January June' Suwa Subject: Re: [PATCH] xtensa: Prevent emitting integer additions of constant zero To: Max Filippov Cc: GCC Patches References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, 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: Wed, 17 Aug 2022 09:52:50 -0000 On 2022/08/17 4:58, Max Filippov wrote: > Hi Suwa-san, Hi! > > On Tue, Aug 16, 2022 at 5:42 AM Takayuki 'January June' Suwa > wrote: >> >> In a few cases, obviously omitable add instructions can be emitted via >> invoking gen_addsi3. >> >> gcc/ChangeLog: >> >> * config/xtensa/xtensa.md (addsi3_internal): Rename from "addsi3". >> (addsi3): New define_expand in order to reject integer additions of >> constant zero. >> --- >> gcc/config/xtensa/xtensa.md | 14 +++++++++++++- >> 1 file changed, 13 insertions(+), 1 deletion(-) > > with this change a bunch of tests fail to build with the following error: Ah, sorry, I want to withdraw this patch. >> In a few cases As a matter of fact, "in a few cases" is just only one: [xtensa_expand_epilogue() in /gcc/config/xtensa/xtensa.cc] > if (cfun->machine->current_frame_size > 0) > { > if (frame_pointer_needed || /* always reachable with addi */ > cfun->machine->current_frame_size > 1024 || > cfun->machine->current_frame_size <= 127) > { > if (cfun->machine->current_frame_size <= 127) > offset = cfun->machine->current_frame_size; > else > offset = cfun->machine->callee_save_size; > > emit_insn (gen_addsi3 (stack_pointer_rtx, > stack_pointer_rtx, > GEN_INT (offset))); // offset can be zero! > } And adding "define_expand" only to deal with one rare case had too much impact, as you saw... > undefined reference to `__addsi3' > > E.g. gcc.c-torture/execute/20000519-1.c > or gcc.c-torture/execute/20070919-1.c >