From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4860 invoked by alias); 23 Aug 2006 10:26:14 -0000 Received: (qmail 4821 invoked by uid 48); 23 Aug 2006 10:26:04 -0000 Date: Wed, 23 Aug 2006 10:26:00 -0000 Message-ID: <20060823102604.4820.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/28814] [4.1/4.2 regression] in compare_values, at tree-vrp.c:415 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-08/txt/msg01930.txt.bz2 List-Id: ------- Comment #5 from rguenth at gcc dot gnu dot org 2006-08-23 10:26 ------- We have mismatched types coming into #4 0x086244c4 in vrp_evaluate_conditional (cond=0xb7d2b168, use_equiv_p=1 '\001') at /space/rguenther/src/svn/sse-revert/gcc/tree-vrp.c:3717 3717 return compare_name_with_value (TREE_CODE (cond), op0, op1); (gdb) call debug_tree (cond) unit size align 8 symtab 0 alias set -1 precision 1 min max > arg 0 unit size align 32 symtab 0 alias set -1 precision 32 min max > visited var def_stmt version 1> arg 1 constant invariant 1> t.i:11> #5 0x0821544f in fold_predicate_in (stmt=0xb7d330c8) at /space/rguenther/src/svn/sse-revert/gcc/tree-ssa-propagate.c:1045 1045 val = vrp_evaluate_conditional (*pred_p, true); (gdb) call debug_generic_expr (stmt) if (r9887D.1606_1 == 1B) goto ; else goto ; which fold produces here: /* If this is an EQ or NE comparison of a constant with a PLUS_EXPR or a MINUS_EXPR of a constant, we can convert it into a comparison with a revised constant as long as no overflow occurs. */ if (TREE_CODE (arg1) == INTEGER_CST && (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR) && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST && 0 != (tem = const_binop (TREE_CODE (arg0) == PLUS_EXPR ? MINUS_EXPR : PLUS_EXPR, arg1, TREE_OPERAND (arg0, 1), 0)) && ! TREE_CONSTANT_OVERFLOW (tem)) return fold_build2 (code, type, TREE_OPERAND (arg0, 0), tem); tem is of pointer type, but arg0 is of type unsigned int. I have a fix. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2006-08-23 07:05:53 |2006-08-23 10:26:04 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28814