From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28463 invoked by alias); 24 Apr 2003 04:56:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 28440 invoked by uid 71); 24 Apr 2003 04:56:00 -0000 Date: Thu, 24 Apr 2003 04:56:00 -0000 Message-ID: <20030424045600.28439.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Richard Henderson Subject: Re: optimization/10315: [3.2/3.3 regression] [powerpc] ICE: in extract_insn, at recog.c:2175 Reply-To: Richard Henderson X-SW-Source: 2003-04/txt/msg01014.txt.bz2 List-Id: The following reply was made to PR optimization/10315; it has been noted by GNATS. From: Richard Henderson To: David Edelsohn , Geoff Keating , s.bosscher@student.tudelft.nl, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, adconrad@0c3.net, 186299@bugs.debian.org, gcc-patches@gcc.gnu.org Cc: Subject: Re: optimization/10315: [3.2/3.3 regression] [powerpc] ICE: in extract_insn, at recog.c:2175 Date: Wed, 23 Apr 2003 21:51:18 -0700 On Wed, Apr 23, 2003 at 03:50:43PM -0700, Richard Henderson wrote: > This is the same as PR8300, which I am looking at today. Well, not quite the same. There are a couple of bugs here, any one of which will fix the crash. First, rs6000_emit_move decided that any time it was called with a non-general_operand input, that it must be reload doing something weird. The attached patch (which has only been cross-tested vs the pr test case) would appear to do the right thing. Would someone please give this proper bootstrap testing? Second, gen_move_insn doesn't have nearly the sort of checks performed by emit_move_insn. This is certainly a bug. IMO gen_move_insn should be implemented as rtx gen_move_insn (dst, src) { start_sequence (); emit_move_insn (dst, src); ret = get_insns (); end_sequence (); return ret; } However, I'm sure this will break something, though I don't know what. Certainly we should explore something like this for mainline, but ... r~ * config/rs6000/rs6000.c (rs6000_emit_move): Only elide proper checks during reload; use validize_mem instead of adjust_address. Index: config/rs6000/rs6000.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v retrieving revision 1.403.2.6 diff -c -p -d -r1.403.2.6 rs6000.c *** config/rs6000/rs6000.c 1 Apr 2003 10:14:13 -0000 1.403.2.6 --- config/rs6000/rs6000.c 24 Apr 2003 04:42:11 -0000 *************** rs6000_emit_move (dest, source, mode) *** 2640,2655 **** } } ! /* Handle the case where reload calls us with an invalid address; ! and the case of CONSTANT_P_RTX. */ ! if (!ALTIVEC_VECTOR_MODE (mode) && (! general_operand (operands[1], mode) ! || ! nonimmediate_operand (operands[0], mode) ! || GET_CODE (operands[1]) == CONSTANT_P_RTX)) ! { ! emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1])); ! return; ! } /* FIXME: In the long term, this switch statement should go away and be replaced by a sequence of tests based on things like --- 2640,2654 ---- } } ! /* Handle the case where reload calls us with an invalid address. */ ! if (reload_in_progress && mode == Pmode && (! general_operand (operands[1], mode) ! || ! nonimmediate_operand (operands[0], mode))) ! goto emit_set; ! ! /* Handle the case of CONSTANT_P_RTX. */ ! if (GET_CODE (operands[1]) == CONSTANT_P_RTX) ! goto emit_set; /* FIXME: In the long term, this switch statement should go away and be replaced by a sequence of tests based on things like *************** rs6000_emit_move (dest, source, mode) *** 2864,2876 **** /* Above, we may have called force_const_mem which may have returned an invalid address. If we can, fix this up; otherwise, reload will have to deal with it. */ ! if (GET_CODE (operands[1]) == MEM ! && ! memory_address_p (mode, XEXP (operands[1], 0)) ! && ! reload_in_progress) ! operands[1] = adjust_address (operands[1], mode, 0); emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1])); - return; } /* Initialize a variable CUM of type CUMULATIVE_ARGS --- 2863,2873 ---- /* Above, we may have called force_const_mem which may have returned an invalid address. If we can, fix this up; otherwise, reload will have to deal with it. */ ! if (GET_CODE (operands[1]) == MEM && ! reload_in_progress) ! operands[1] = validize_mem (operands[1]); + emit_set: emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1])); } /* Initialize a variable CUM of type CUMULATIVE_ARGS