This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Loop clean up
Clinton Popetz writes:
> This is a problem with Michael's original loop patch. See my recent
> mesg under "[Re: [EGCS 2.96, 2000/01/17 snapshot] Internal compiler
> error in loop_iterations" or at:
>
> http://gcc.gnu.org/ml/gcc-bugs/2000-01/msg00475.html
Yes, I somehow didn't slurp up Bernd's patch and never noticed the
regression since my vanilla source tree had the same bug. My
apologies.
After working through the problem, I think the following should be a
better solution to what was proposed by Bernd. I do not notice any
new regressions with this. Shall I commit it to right the ship?
Michael.
Index: unroll.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/unroll.c,v
retrieving revision 1.87
diff -c -3 -p -r1.87 unroll.c
*** unroll.c 2000/01/17 15:55:18 1.87
--- unroll.c 2000/01/19 05:21:56
*************** loop_iterations (loop)
*** 3702,3711 ****
return 0;
}
! /* The only new registers that care created before loop iterations are
! givs made from biv increments, so this should never occur. */
! if ((unsigned) REGNO (iteration_var) >= reg_iv_type->num_elements)
abort ();
iteration_info (iteration_var, &initial_value, &increment,
--- 3702,3715 ----
return 0;
}
! /* The only new registers that are created before loop iterations
! are givs made from biv increments or registers created by
! load_mems. In the latter case, it is possible that try_copy_prop
! will propagate a new pseudo into the old iteration register but
! this will be marked by having the REG_USERVAR_P bit set. */
! if ((unsigned) REGNO (iteration_var) >= reg_iv_type->num_elements
! && ! REG_USERVAR_P (iteration_var))
abort ();
iteration_info (iteration_var, &initial_value, &increment,