From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77971 invoked by alias); 21 Feb 2017 15:09:07 -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 77949 invoked by uid 89); 21 Feb 2017 15:09:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*r:8.13.8 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, 21 Feb 2017 15:09:05 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id v1LF8Wuh032345; Tue, 21 Feb 2017 09:08:33 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id v1LF8PqY032312; Tue, 21 Feb 2017 09:08:25 -0600 Date: Tue, 21 Feb 2017 15:16:00 -0000 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: gnu@amylaar.uk, segher@kernel.crashing.org Subject: [PATCH] arc: Fixes for RTL checking Message-ID: <20170221150824.GN21840@gate.crashing.org> References: 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-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg01301.txt.bz2 Whoops, I forgot one. Here it is. Joern, please see . 2017-02-21 Segher Boessenkool * config/arc/arc.c (arc_ccfsm_advance): Only take the PATTERN of this_insn if it is an INSN or JUMP_INSN. (force_offsettable): Look at base, not at addr. * config/arc/predicates.md (brcc_nolimm_operator): Don't call INTVAL on things that aren' necessarily CONST_INTs. --- gcc/config/arc/arc.c | 8 +++++--- gcc/config/arc/predicates.md | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 8a838f9..4c99f1d 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -3832,8 +3832,6 @@ arc_ccfsm_advance (rtx_insn *insn, struct arc_ccfsm *state) break; } - scanbody = PATTERN (this_insn); - switch (GET_CODE (this_insn)) { case CODE_LABEL: @@ -3868,6 +3866,8 @@ arc_ccfsm_advance (rtx_insn *insn, struct arc_ccfsm *state) break; case JUMP_INSN: + scanbody = PATTERN (this_insn); + /* If this is an unconditional branch to the same label, succeed. If it is to another label, do nothing. If it is conditional, fail. */ @@ -3902,6 +3902,8 @@ arc_ccfsm_advance (rtx_insn *insn, struct arc_ccfsm *state) break; case INSN: + scanbody = PATTERN (this_insn); + /* We can only do this with insns that can use the condition codes (and don't set them). */ if (GET_CODE (scanbody) == SET @@ -7401,7 +7403,7 @@ force_offsettable (rtx addr, HOST_WIDE_INT size, bool reuse) } if (!REG_P (base) || (REGNO (base) != STACK_POINTER_REGNUM - && REGNO_PTR_FRAME_P (REGNO (addr))) + && REGNO_PTR_FRAME_P (REGNO (base))) || !CONST_INT_P (offs) || !SMALL_INT (INTVAL (offs)) || !SMALL_INT (INTVAL (offs) + size)) { diff --git a/gcc/config/arc/predicates.md b/gcc/config/arc/predicates.md index 159a6b4..0dec736 100644 --- a/gcc/config/arc/predicates.md +++ b/gcc/config/arc/predicates.md @@ -458,8 +458,10 @@ (define_predicate "ge_lt_comparison_operator" (define_predicate "brcc_nolimm_operator" (ior (match_test "REG_P (XEXP (op, 1))") (and (match_code "eq, ne, lt, ge, ltu, geu") + (match_test "CONST_INT_P (XEXP (op, 1))") (match_test "u6_immediate_operand (XEXP (op, 1), SImode)")) (and (match_code "le, gt, leu, gtu") + (match_test "CONST_INT_P (XEXP (op, 1))") (match_test "UNSIGNED_INT6 (INTVAL (XEXP (op, 1)) + 1)")))) ;; Return TRUE if this is the condition code register, if we aren't given -- 1.9.3