From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id A0C3B3858C27; Sat, 12 Mar 2022 10:48:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A0C3B3858C27 Received: from [IPv6:240e:358:11d9:b600:dc73:854d:832e:4] (unknown [IPv6:240e:358:11d9:b600:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id 2767E6635C; Sat, 12 Mar 2022 05:48:31 -0500 (EST) Message-ID: <4ec3ce765b9959334d2a3e08d8957fc2fcf57f7d.camel@mengyan1223.wang> Subject: Re: [PATCH RFC] mips: add TARGET_ZERO_CALL_USED_REGS hook [PR104817, PR104820] From: Xi Ruoyao To: Qing Zhao , Richard Sandiford Cc: YunQiang Su , "gcc-patches@gcc.gnu.org" , Jakub Jelinek , Jeff Law Date: Sat, 12 Mar 2022 18:48:24 +0800 In-Reply-To: References: <93ab62b2b9473733e5118f4265b61804978adfd7.camel@mengyan1223.wang> <53408AB1-0FA4-4529-95D9-A10FA8999DF6@oracle.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3031.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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: Sat, 12 Mar 2022 10:48:38 -0000 On Fri, 2022-03-11 at 21:26 +0000, Qing Zhao wrote: > Hi, Ruoyao, > > (I might not be able to reply to this thread till next Wed due to a > short vacation). > > First, some comments on opening bugs against Gcc: > > I took a look at the bug reports PR104817 and PR104820: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104820 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104817 > > I didn’t see a testing case and a script to repeat the error, so I > cannot repeat the error at my side. I've put the test case, but maybe you didn't see it because it is too simple: echo 'int t() {}' | /home/xry111/git-repos/gcc-test-mips/gcc/cc1 -nostdinc -fzero-call-used-regs=all An empty function is enough to break -fzero-call-used-regs=all. And if you append -mips64r2 to the cc1 command line you'll get 104820. I enabled 4 existing tests for MIPS (reported "not work" on MIPS) in the patch so I think it's unnecessary to add new test cases. Richard: can we use MIPS_EPILOGUE_TEMP as a scratch register in the sequence for zeroing the call-used registers, and then zero itself (despite it's not in need_zeroed_hardregs)? -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University