From patchwork Thu Mar 24 10:04:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 766 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:36 -0000 Delivered-To: patches@linaro.org Received: by 10.42.161.68 with SMTP id s4cs93112icx; Thu, 24 Mar 2011 03:04:09 -0700 (PDT) Received: by 10.216.60.193 with SMTP id u43mr496202wec.103.1300961047507; Thu, 24 Mar 2011 03:04:07 -0700 (PDT) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id r15si16420427wec.102.2011.03.24.03.04.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2011 03:04:07 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of richard.sandiford@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of richard.sandiford@linaro.org) smtp.mail=richard.sandiford@linaro.org Received: by wyj26 with SMTP id 26so9897748wyj.37 for ; Thu, 24 Mar 2011 03:04:07 -0700 (PDT) Received: by 10.216.80.25 with SMTP id j25mr7352159wee.35.1300961046756; Thu, 24 Mar 2011 03:04:06 -0700 (PDT) Received: from richards-thinkpad (gbibp9ph1--blueice2n1.emea.ibm.com [195.212.29.75]) by mx.google.com with ESMTPS id h39sm3670003wes.29.2011.03.24.03.04.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2011 03:04:05 -0700 (PDT) From: Richard Sandiford To: "Anatoly Sokolov" Mail-Followup-To: "Anatoly Sokolov" , "Richard Henderson" , , , "Jeff Law" , , richard.sandiford@linaro.org Cc: "Richard Henderson" , , , "Jeff Law" , Subject: Re: Cleaning up expand optabs code References: <4D825EF5.1010307@redhat.com> <87wrju28hn.fsf@firetop.home> <4D87A69B.90704@redhat.com> <4D88E10A.8080005@redhat.com> Date: Thu, 24 Mar 2011 10:04:02 +0000 In-Reply-To: (Anatoly Sokolov's message of "Wed, 23 Mar 2011 21:00:34 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 "Anatoly Sokolov" writes: > This patch casue ICE on H8300 target: This is due to jump_address_operand checking the wrong mode. The predicate is: (define_predicate "jump_address_operand" (match_code "reg,mem") { if (GET_CODE (op) == REG) return mode == Pmode; [...] } but "mode" is the mode passed to the predicate, not the mode of OP. The indirect_jump pattern is: (define_expand "indirect_jump" [(set (pc) (match_operand 0 "jump_address_operand" ""))] "" "") which says that VOIDmode should be passed to jump_address_operand, so all registers end up being rejected. I've applied the following as the obvious fix. You then hit bug 48263 ( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48263 ); I'm testing a fix for that now. Richard gcc/ * config/h8300/predicates.md (jump_address_operand): Fix register mode check. Index: gcc/config/h8300/predicates.md =================================================================== --- gcc/config/h8300/predicates.md 2011-01-05 15:12:08.000000000 +0000 +++ gcc/config/h8300/predicates.md 2011-03-24 09:20:15.000000000 +0000 @@ -259,7 +259,7 @@ (define_predicate "jump_address_operand" (match_code "reg,mem") { if (GET_CODE (op) == REG) - return mode == Pmode; + return GET_MODE (op) == Pmode; if (GET_CODE (op) == MEM) {