From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25556 invoked by alias); 31 Mar 2008 16:11:37 -0000 Received: (qmail 25071 invoked by alias); 31 Mar 2008 16:11:01 -0000 Date: Mon, 31 Mar 2008 16:11:00 -0000 Message-ID: <20080331161101.25070.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/35768] gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload, at reload1.c:7331 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rsandifo at nildram dot co dot uk" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg02551.txt.bz2 ------- Comment #4 from rsandifo at nildram dot co dot uk 2008-03-31 16:11 ------- Subject: Re: gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload, at reload1.c:7331 "danglin at gcc dot gnu dot org" writes: > Richard, does match_scratch now require a mode? The pattern causing > the problem was written without a mode so that it could handle both > SImode and DImode. Hmm. Well, the use of a modeless "match_scratch" in a matching context is OK. It's the use of a modeless "(scratch)" rtx (and thus a modeless "match_scratch" in an expander or named insn) that's the problem. It does seem odd for an output "(scratch)" to have no mode. From a quick check, it seems PA is the only port to use voidless "(scratch)" rtxes for output operands that really do need reloads. Other ports either add the mode to the "match_scratch" or get the associated expander to call "gen_rtx_SCRATCH (mode)". See s390.md for an example of the latter. I suppose the assumption in pa.md is that the scratch output reload should be in the same mode as the input operand. However, the point of my patch was that they needn't be: matched input-output operands can have different modes, and in every other case except the PA one, the mode of the output value determines the mode of the output reload register. If we want to continue to allow this, the fix is to change: if (rl->out && reg_rtx) into: if (rl->out && reg_rtx && !(GET_CODE (rl->out) == SCRATCH && GET_MODE (rl->out) == VOIDmode)) in reload1.c. What do you think? Should pa.md be changed (probably along the same lines as s390.md) or do you want to go with the reload change? Richard -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35768