From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127345 invoked by alias); 24 Jan 2018 14:07:13 -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 127311 invoked by uid 89); 24 Jan 2018 14:07:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Jan 2018 14:07:09 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78DF2AB084; Wed, 24 Jan 2018 14:07:08 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-22.ams2.redhat.com [10.36.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D47316017B; Wed, 24 Jan 2018 14:07:07 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w0OE75lC015103; Wed, 24 Jan 2018 15:07:05 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w0OE737Z014022; Wed, 24 Jan 2018 15:07:03 +0100 Date: Wed, 24 Jan 2018 14:19:00 -0000 From: Jakub Jelinek To: Tom de Vries Cc: GCC Patches , Richard Biener Subject: Re: [PATCH, 2/2][nvptx, PR83589] Workaround for branch-around-nothing JIT bug Message-ID: <20180124140703.GB2063@tucnak> Reply-To: Jakub Jelinek References: <34fb1d00-dc5d-04f2-d601-ee6fe710ac3b@mentor.com> <20180124110305.GZ2063@tucnak> <4909fc79-df36-16b1-78d0-e9cd9da4080e@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4909fc79-df36-16b1-78d0-e9cd9da4080e@mentor.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg02025.txt.bz2 On Wed, Jan 24, 2018 at 02:56:28PM +0100, Tom de Vries wrote: > +#if WORKAROUND_PTXJIT_BUG_2 > +/* Variant of pc_set that only requires JUMP_P (INSN) if STRICT. This variant > + is needed in the nvptx target because the branches generated for > + parititioning are NONJUMP_INSN_P, not JUMP_P. */ > + > +static rtx > +nvptx_pc_set (const rtx_insn *insn, bool strict = true) > +{ > + rtx pat; > + if ((strict && !JUMP_P (insn)) > + || (!strict && !INSN_P (insn))) > + return NULL_RTX; > + pat = PATTERN (insn); > + > + /* The set is allowed to appear either as the insn pattern or > + the first set in a PARALLEL. */ > + if (GET_CODE (pat) == PARALLEL) > + pat = XVECEXP (pat, 0, 0); This could have been single_set. > + if (!x) > + return NULL_RTX; > + x = SET_SRC (x); > + if (GET_CODE (x) == LABEL_REF) > + return x; > + if (GET_CODE (x) != IF_THEN_ELSE) > + return NULL_RTX; > + if (XEXP (x, 2) == pc_rtx && GET_CODE (XEXP (x, 1)) == LABEL_REF) > + return XEXP (x, 1); > + if (XEXP (x, 1) == pc_rtx && GET_CODE (XEXP (x, 2)) == LABEL_REF) > + return XEXP (x, 2); > + return NULL_RTX; And this looks like condjump_label. What are the nvptx conditional jumps that aren't JUMP_INSN and why? That looks like a bad idea. Otherwise, there is also JUMP_LABEL (insn)... Jakub