------- Comment #1 from rguenth at gcc dot gnu dot org  2007-02-09 13:21 -------
Confirmed.  Wrong types in comparison:

#5  0x000000000094f7ff in fold_predicate_in (stmt=0x2b5158e17690)
    at /space/rguenther/src/svn/trunk/gcc/tree-ssa-propagate.c:1106
1106      val = vrp_evaluate_conditional (*pred_p, true);
(gdb) call debug_generic_expr (stmt)
if (p_1(D) != -1B) goto <L0>; else goto <L1>;

(gdb) call debug_tree (cond)
 <ne_expr 0x2b5158e1c200
    type <boolean_type 0x2b5158e219c0 _Bool public unsigned QI
        size <integer_cst 0x2b5158e11810 constant invariant 8>
        unit size <integer_cst 0x2b5158e11840 constant invariant 1>
        align 8 symtab 0 alias set -1 canonical type 0x2b5158e219c0 precision 1
min <integer_cst 0x2b5158e11d20 0> max <integer_cst 0x2b5158e11d80 1>>

    arg 0 <ssa_name 0x2b5158f6cde0
        type <integer_type 0x2b5158e21780 long unsigned int sizes-gimplified
public unsigned DI
            size <integer_cst 0x2b5158e11ba0 constant invariant 64>
            unit size <integer_cst 0x2b5158e11bd0 constant invariant 8>
            align 64 symtab 0 alias set -1 canonical type 0x2b5158e21780
precision 64 min <integer_cst 0x2b5158e11c00 0> max <integer_cst 0x2b5158e11b70
18446744073709551615>>
        volatile visited var <var_decl 0x2b5158f79000 p> def_stmt <nop_expr
0x2b5158e1c840>
        version 1>
    arg 1 <integer_cst 0x2b5158e2eb40 type <pointer_type 0x2b5158e31300>
constant invariant 18446744073709551615>
    t.i:8>

>From the beginning:

;; enabled by -tree-original


{
  long unsigned int p;

    long unsigned int p;
  if (p != -1B)
    {
      ((struct G *) (void *) ~p)->unique = n->unique;
    }
}

We fold (void *)~p != (void *)0 to p != (void *)-1 here:

fold_comparison (...
...
  /* Fold ~X op C as X op' ~C, where op' is the swapped comparison.  */
  if (TREE_CODE (arg0) == BIT_NOT_EXPR
      && TREE_CODE (arg1) == INTEGER_CST)
    return fold_build2 (swap_tree_comparison (code), type,
                        TREE_OPERAND (arg0, 0),
                        fold_build1 (BIT_NOT_EXPR, TREE_TYPE (arg1), arg1));

but arg0 has NOPs stripped.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |roger at eyesopen dot com
             Status|UNCONFIRMED                 |NEW
          Component|tree-optimization           |middle-end
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-02-09 13:21:38
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30744

Reply via email to