http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45122
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|wrong-code |diagnostic --- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-10 14:45:27 UTC --- We assume the loop iterates with induction variable a from zero to ((unsigned long)((unsigned)(((int)x->b) - 8) /[ex] 8)) & 536870911 + 1 which is one iteration less than required. The assumptions made from niter analysis for that to be valid is ((unsigned int) D.2724_6 & 7) == 0 which isn't satisfied (it's 1). So, technically we run into if (flag_unsafe_loop_optimizations) niter->assumptions = boolean_true_node; and assume the above holds true. We add this assumption here: if (!exit_must_be_taken) { /* If we cannot assume that the exit is taken eventually, record the assumptions for divisibility of c. */ assumption = fold_build2 (FLOOR_MOD_EXPR, niter_type, c, d); assumption = fold_build2 (EQ_EXPR, boolean_type_node, assumption, build_int_cst (niter_type, 0)); thus a proper warning wording would say sth about that reason.