------- Comment #6 from rguenth at gcc dot gnu dot org 2008-09-02 09:04 ------- It looks like SCEV does not see that for
(number_of_iterations_in_loop (analyze_scalar_evolution (loop_nb = 4) (scalar = j_3) (get_scalar_evolution (scalar = j_3) (scalar_evolution = )) (analyze_initial_condition (loop_phi_node = j_3 = PHI <j_26(4), j_31(7)> ) (init_cond = j_26)) (analyze_evolution_in_loop (loop_phi_node = j_3 = PHI <j_26(4), j_31(7)> ) (add_to_evolution (loop_nb = 4) (chrec_before = j_26) (to_add = 1) (res = {j_26, +, 1}_4)) (evolution_function = {j_26, +, 1}_4)) (set_scalar_evolution (scalar = j_3) (scalar_evolution = {j_26, +, 1}_4)) ) j_26 is defined by <bb 4>: # j_26 = PHI <0(3), 0(5), 0(12), 0(6)> so it is all zeros. This is because the "iterative" unrolling only does a cfg cleanup between iterations and not a full constant-prop. We can "fix" this special case in analyze_initial_condition, but a real fix would be to run a (partial) CCP pass after each set of unrolling. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37221