------- Comment #4 from uros at kss-loka dot si 2006-07-18 07:29 ------- This is the backtrace for the testcase in comment #3:
#1 0x0827ae67 in fold_binary_to_constant (code=TRUNC_MOD_EXPR, type=0x402473f4, op0=0x402d9438, op1=0x0) at ../../gcc-svn/trunk/gcc/fold-const.c:12314 #2 0x08174b25 in constant_multiple_of (type=0x402473f4, top=0x402d9438, bot=0x0) at ../../gcc-svn/trunk/gcc/tree-ssa-loop-ivopts.c:2623 #3 0x081799d1 in get_computation_cost (data=0xbffff704, use=0x8706e70, cand=0x8707358, address_p=0 '\0', depends_on=0xbffff5f4) at ../../gcc-svn/trunk/gcc/tree-ssa-loop-ivopts.c:3758 #4 0x0817a364 in determine_use_iv_cost (data=0xbffff704, use=0x8706e70, cand=0x8707358) at ../../gcc-svn/trunk/gcc/tree-ssa-loop-ivopts.c:3901 #5 0x0817d41e in determine_use_iv_costs (data=0xbffff704) at ../../gcc-svn/trunk/gcc/tree-ssa-loop-ivopts.c:4128 #6 0x0817f3ac in tree_ssa_iv_optimize_loop (data=0xbffff704, loop=Variable "loop" is not available. constant_multiple_of() is calling fold_binary_to_constant() here: if (!zero_p (fold_binary_to_constant (TRUNC_MOD_EXPR, type, top, bot))) return NULL_TREE; As can be seen from backtrace above, "bot" operand is NULL, and this triggers assert in fold_binary(). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28411