From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32008 invoked by alias); 29 May 2002 16:16:18 -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 31961 invoked by uid 71); 29 May 2002 16:16:11 -0000 Date: Wed, 29 May 2002 09:16:00 -0000 Message-ID: <20020529161610.31957.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Eric Botcazou" Subject: Re: optimization/6822: GCC 3.1.1 - Internal compiler error in extract_insn, at recog.c:2132 Reply-To: "Eric Botcazou" X-SW-Source: 2002-05/txt/msg00957.txt.bz2 List-Id: The following reply was made to PR optimization/6822; it has been noted by GNATS. From: "Eric Botcazou" To: "Richard Henderson" Cc: "Glen Nakamura" , , Subject: Re: optimization/6822: GCC 3.1.1 - Internal compiler error in extract_insn, at recog.c:2132 Date: Wed, 29 May 2002 18:11:10 +0200 > The problem is that +128 is not a valid QImode constant. > It should have been rendered as -128. This should have > happened during the conversion to rtl, not in the tree > folding code that Eric touched. The conversion from +127 into +128 happens here: (sorry for the ill-formatting) config/i386/i386.c: int ix86_expand_int_movcc (operands) rtx operands[]; { enum rtx_code code = GET_CODE (operands[1]), compare_code; rtx compare_seq, compare_op; rtx second_test, bypass_test; enum machine_mode mode = GET_MODE (operands[0]); /* When the compare code is not LTU or GEU, we can not use sbbl case. In case comparsion is done with immediate, we can convert it to LTU or GEU by altering the integer. */ if ((code == LEU || code == GTU) && GET_CODE (ix86_compare_op1) == CONST_INT && mode != HImode && (unsigned int) INTVAL (ix86_compare_op1) != 0xffffffff /* The operand still must be representable as sign extended value. */ && (!TARGET_64BIT || GET_MODE (ix86_compare_op0) != DImode || (unsigned int) INTVAL (ix86_compare_op1) != 0x7fffffff) && (GET_MODE (ix86_compare_op0) != QImode || (unsigned int) INTVAL (ix86_compare_op1) != 0x7f) && GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[3]) == CONST_INT) { if (code == LEU) code = LTU; else code = GEU; ix86_compare_op1 = GEN_INT (INTVAL (ix86_compare_op1) + 1); } As an evidence, the following 2-line patch lets the ICE vanish: --- gcc/config/i386/i386.c.orig Wed May 29 17:14:21 2002 +++ gcc/config/i386/i386.c Wed May 29 17:28:45 2002 @@ -7963,6 +7963,8 @@ && (!TARGET_64BIT || GET_MODE (ix86_compare_op0) != DImode || (unsigned int) INTVAL (ix86_compare_op1) != 0x7fffffff) + && (GET_MODE (ix86_compare_op0) != QImode + || (unsigned int) INTVAL (ix86_compare_op1) != 0x7f) && GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[3]) == CONST_INT) { What's your diagnosis ? -- Eric Botcazou ebotcazou@multimania.com