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 15BE93858C53; Wed, 14 Jun 2023 16:09:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 15BE93858C53 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 35EG8fiC013187; Wed, 14 Jun 2023 11:08:41 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 35EG8eTK013184; Wed, 14 Jun 2023 11:08:40 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 14 Jun 2023 11:08:40 -0500 From: Segher Boessenkool To: Richard Biener Cc: Richard Sandiford , Jiufu Guo , gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, bergner@linux.ibm.com, jeffreyalaw@gmail.com Subject: Re: [PATCH] rs6000: replace '(const_int 0)' to 'unspec:BLK [(const_int 0)]' for stack_tie Message-ID: <20230614160840.GZ19790@gate.crashing.org> References: <20230613122335.2108620-1-guojiufu@linux.ibm.com> <20230613183320.GU19790@gate.crashing.org> <7no7liadru.fsf@ltcden2-lp1.aus.stglabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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! On Wed, Jun 14, 2023 at 09:52:37AM +0000, Richard Biener wrote: > I see. So > > (parallel > (unspec stack_tie) > (clobber (mem:BLK ...))) Written like this, without a "set", *every* unspec has to be an unspec_volatile, for the same reason as all inline asms without outputs always are considered volatile asm. The "unspec" arm of the parallel can be omitted, and if that is valid RTL (possibly after other changes, like omitting the parallel,replacing it by its one remaining arm), this is a prefectly valid transformation. > I suppose it needs to be an unspec_volatile? It feels like > the stack_ties are a delicate hack preventing enough but not too > much optimization ... Yes. So let's please not disturb it :-) It isn't a "delicate" hack I would say, but its effects are needed in some places, and messing it up leads to hard to debug problems. Which had happened time and time again over the years. It just is hard to deal with variable sized stack adjustments and the like. As long as we only use stack ties in such unusual cases, all is fine. There are worse things, like what we have the frame_pointer_needed_indeed thing for :-) Segher