From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33972 invoked by alias); 18 Sep 2018 14:04:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 33956 invoked by uid 89); 18 Sep 2018 14:04:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=specialised, Hx-languages-length:1309 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Sep 2018 14:04:44 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w8IE4ewM019936; Tue, 18 Sep 2018 09:04:41 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id w8IE4dJm019917; Tue, 18 Sep 2018 09:04:39 -0500 Date: Tue, 18 Sep 2018 14:10:00 -0000 From: Segher Boessenkool To: Ilya Leoshkevich Cc: gcc-patches@gcc.gnu.org, krebbel@linux.ibm.com, rdapp@linux.ibm.com Subject: Re: [PATCH] S/390: Fix conditional returns Message-ID: <20180918140438.GP23155@gate.crashing.org> References: <20180905083448.1689-1-iii@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180905083448.1689-1-iii@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00989.txt.bz2 On Wed, Sep 05, 2018 at 10:34:48AM +0200, Ilya Leoshkevich wrote: > S/390 epilogue ends with (parallel [(return) (use %r14)]) instead of > the more usual (return) or (simple_return). This sequence is not > recognized by the conditional return logic in try_optimize_cfg (). Why does it need this? Other targets with a link register make EPILOGUE_USES handle this. If you really need a parallel, can you make ANY_RETURN_P recognise it? > +/* Create a copy of PARALLEL with side-effect OSIDE replaced by NSIDE. */ > +static rtx > +copy_update_parallel (rtx par, rtx *oside, rtx nside) > +{ > + rtx npar; > + int i; > + > + npar = gen_rtx_PARALLEL (GET_MODE (par), rtvec_alloc (XVECLEN (par, 0))); > + for (i = XVECLEN (par, 0) - 1; i >= 0; i--) > + { > + rtx *side_effect = &XVECEXP (par, 0, i); > + > + if (side_effect == oside) > + XVECEXP (npar, 0, i) = nside; > + else > + XVECEXP (npar, 0, i) = copy_rtx (*side_effect); > + } > + return npar; > +} This doesn't work if nside is used anywhere else. But the only caller uses the previous instruction pattern; maybe make a function specialised to that only? You could give it a better name, too ;-) (It is especially surprising because the function is called copy_* but it does _not_ copy its argument!) Segher