------- Additional Comments From danglin at gcc dot gnu dot org 2005-03-17 03:13 ------- Breakpoint 1, do_compare_and_jump (exp=0x400de208, signed_code=EQ, unsigned_code=EQ, if_false_label=0x40166ca8, if_true_label=0x0) at ../../gcc/gcc/dojump.c:930 930 if (HAVE_canonicalize_funcptr_for_compare (gdb) p debug_tree (exp) <eq_expr 0x400de208 type <boolean_type 0x400dc620 _Bool public unsigned QI size <integer_cst 0x400d30f0 constant invariant 8> unit size <integer_cst 0x400d3108 constant invariant 1> align 8 symtab 0 alias set -1 precision 1 min <integer_cst 0x400d34e0 0> max <integer_cst 0x400d3510 1>>
arg 0 <parm_decl 0x40146e00 fptr type <pointer_type 0x401467e0 fptr_t type <function_type 0x400e9540> unsigned SI size <integer_cst 0x400d32e8 constant invariant 32> unit size <integer_cst 0x400d3078 constant invariant 4> align 32 symtab 0 alias set -1> used unsigned SI file fptr.c line 60 size <integer_cst 0x400d32e8 32> unit size <integer_cst 0x400d3078 4> align 32 context <function_decl 0x40146d90 __canonicalize_funcptr_for_compare> result <pointer_type 0x401467e0 fptr_t> initial <pointer_type 0x401467e0 fptr_t> (reg/v/f:SI 124 [ fptr ]) arg-type <pointer_type 0x401467e0 fptr_t> arg- type-as-written <pointer_type 0x401467e0 fptr_t> incoming-rtl (reg:SI 26 %r26 [ fptr ])> arg 1 <integer_cst 0x4014b180 type <pointer_type 0x401467e0 fptr_t> constant invariant 4294967295>> $1 = void (gdb) Your patch may fix the problem. However, I'm concerned that I don't see any indication in the tree that the int cast has been respected. Rather, it looks as if -1 has been converted to a pointer type. Possibly, Roger should look at this as I think it was his patch on the 13th that introduced/exposed the problem. 2005-03-13 Roger Sayle <[EMAIL PROTECTED]> PR middle-end/19331 * tree.c (get_unwidened): Treat CONVERT_EXPR and NOP_EXPR identically. * fold-const.c (fold_sign_changed_comparison): Likewise. (fold_binary): Optimize comparisons against widened operands if the extension is represented by a CONVERT_EXPR, same as a NOP_EXPR. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |roger at eyesopen dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20493