------- 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)
 <eq_expr 0xb7d2b168
    type <boolean_type 0xb7d364ac _Bool public unsigned QI
        size <integer_cst 0xb7d241f8 constant invariant 8>
        unit size <integer_cst 0xb7d24210 constant invariant 1>
        align 8 symtab 0 alias set -1 precision 1 min <integer_cst 0xb7d245e8
0> max <integer_cst 0xb7d24618 1>>

    arg 0 <ssa_name 0xb7dbb270
        type <integer_type 0xb7d362e0 unsigned int sizes-gimplified public
unsigned SI
            size <integer_cst 0xb7d243f0 constant invariant 32>
            unit size <integer_cst 0xb7d24180 constant invariant 4>
            align 32 symtab 0 alias set -1 precision 32 min <integer_cst
0xb7d24468 0> max <integer_cst 0xb7d24450 4294967295>>
        visited var <var_decl 0xb7d30108 r9887> def_stmt <nop_expr 0xb7db8240>
        version 1>
    arg 1 <integer_cst 0xb7d24d98 type <pointer_type 0xb7d368fc> 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 <L0>; else goto <L1>;

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

Reply via email to