------- Comment #2 from dje at transmeta dot com 2005-11-03 18:18 ------- I'm not sure the root cause of this bug is fixed in 4.1. It looks to me like it's still there and is only (currently) hidden. Am I mistaken?
Apply this patch to gcc-4.1-20051029 and recompile the testcase with -O3. I'm seeing an abort. If I set a breakpoint on integer_nonzerop and print the boolean_true_node tree I see it's marked as "overflow". Oops. --- tree-ssa-loop-ivopts.c.~1~ 2005-09-22 04:24:00.000000000 -0700 +++ tree-ssa-loop-ivopts.c 2005-11-03 10:06:59.997691464 -0800 @@ -1291,6 +1291,8 @@ find_interesting_uses_cond (struct ivopt struct iv const_iv; tree zero = integer_zero_node; + gcc_assert (integer_nonzerop (boolean_true_node)); + const_iv.step = NULL_TREE; if (TREE_CODE (*cond_p) != SSA_NAME (gdb) p expr $1 = 0xb7c32630 (gdb) pt <integer_cst 0xb7c32630 type <boolean_type 0xb7c424ac _Bool> constant invariant static overflow 1> (gdb) f #0 integer_nonzerop (expr=0xb7c32630) at ../../gcc/tree.c:1278 (gdb) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24599