From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52194 invoked by alias); 23 Jul 2015 21:29:00 -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 52170 invoked by uid 89); 23 Jul 2015 21:28:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 23 Jul 2015 21:28:55 +0000 Received: by wibxm9 with SMTP id xm9so2438429wib.0 for ; Thu, 23 Jul 2015 14:28:52 -0700 (PDT) X-Received: by 10.194.86.161 with SMTP id q1mr20599264wjz.18.1437686932398; Thu, 23 Jul 2015 14:28:52 -0700 (PDT) Received: from localhost ([95.144.14.199]) by smtp.googlemail.com with ESMTPSA id q4sm9358547wja.24.2015.07.23.14.28.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2015 14:28:51 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org,nickc@redhat.com, rdsandiford@googlemail.com Cc: nickc@redhat.com Subject: Ping: [fr30] Fix indirect_jump pattern References: <878uagi3zt.fsf@e105548-lin.cambridge.arm.com> Date: Thu, 23 Jul 2015 22:00:00 -0000 In-Reply-To: <878uagi3zt.fsf@e105548-lin.cambridge.arm.com> (Richard Sandiford's message of "Thu, 16 Jul 2015 15:14:30 +0100") Message-ID: <87a8umwoks.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2015-07/txt/msg01987.txt.bz2 Ping Richard Sandiford writes: > The pattern was accepting a nonimediate_operand, using the C condition > to weed out certain types of memory, but was then using an "r" constraint > to force a register. This patch makes the predicate match the constraint > and removes the C condition. > > Tested by building fr30-elf and using: > > int > foo (int i) > { > __typeof(&&a) foo[] = { &&a, &&a, &&b, &&c }; > > restart: > goto *foo[i]; > > a: > return 1; > > b: > i += 1; > goto restart; > > c: > return 2; > } > > to triger an indirect jump (checked via -dp). OK to install? > > Thanks, > Richard > > > gcc/ > * config/fr30/fr30.md (indirect_jump): Use pmode_register_operand > instead of nonimmediate_operand. Remove C condiition. > > Index: gcc/config/fr30/fr30.md > =================================================================== > --- gcc/config/fr30/fr30.md 2015-06-22 14:02:15.165532334 +0100 > +++ gcc/config/fr30/fr30.md 2015-07-13 19:31:50.552692732 +0100 > @@ -1146,8 +1146,8 @@ (define_insn "jump" > > ;; Indirect jump through a register > (define_insn "indirect_jump" > - [(set (pc) (match_operand:SI 0 "nonimmediate_operand" "r"))] > - "GET_CODE (operands[0]) != MEM || GET_CODE (XEXP (operands[0], 0)) != PLUS" > + [(set (pc) (match_operand 0 "pmode_register_operand" "r"))] > + "" > "jmp%#\\t@%0" > [(set_attr "delay_type" "delayed")] > )