From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 3A1033858D38; Tue, 13 Jun 2023 18:34:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A1033858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 35DIXLMW003232; Tue, 13 Jun 2023 13:33:21 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 35DIXK6d003231; Tue, 13 Jun 2023 13:33:20 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 13 Jun 2023 13:33:20 -0500 From: Segher Boessenkool To: Jiufu Guo Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, bergner@linux.ibm.com, rguenther@suse.de, richard.sandiford@arm.com, jeffreyalaw@gmail.com Subject: Re: [PATCH] rs6000: replace '(const_int 0)' to 'unspec:BLK [(const_int 0)]' for stack_tie Message-ID: <20230613183320.GU19790@gate.crashing.org> References: <20230613122335.2108620-1-guojiufu@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613122335.2108620-1-guojiufu@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! As I said in a reply to the original patch: not okay. Sorry. But some comments on this patch: On Tue, Jun 13, 2023 at 08:23:35PM +0800, Jiufu Guo wrote: > + && XINT (SET_SRC (set), 1) == UNSPEC_TIE > + && XVECEXP (SET_SRC (set), 0, 0) == const0_rtx); This makes it required that the operand of an UNSPEC_TIE unspec is a const_int 0. This should be documented somewhere. Ideally you would want no operand at all here, but every unspec has an operand. > + RTVEC_ELT (p, i) > + = gen_rtx_SET (mem, gen_rtx_UNSPEC (BLKmode, gen_rtvec (1, const0_rtx), > + UNSPEC_TIE)); If it is hard to indent your code, your code is trying to do to much. Just have an extra temporary? rtx un = gen_rtx_UNSPEC (BLKmode, gen_rtvec (1, const0_rtx), UNSPEC_TIE); RTVEC_ELT (p, i) = gen_rtx_SET (mem, un); That is shorter even, and certainly more readable :-) > @@ -10828,7 +10829,9 @@ (define_expand "restore_stack_block" > operands[4] = gen_frame_mem (Pmode, operands[1]); > p = rtvec_alloc (1); > RTVEC_ELT (p, 0) = gen_rtx_SET (gen_frame_mem (BLKmode, operands[0]), > - const0_rtx); > + gen_rtx_UNSPEC (BLKmode, > + gen_rtvec (1, const0_rtx), > + UNSPEC_TIE)); > operands[5] = gen_rtx_PARALLEL (VOIDmode, p); I have a hard time to see how this could ever be seen as clearer or more obvious or anything like that :-( Segher