This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [egcs-19980531] Optimization bug pe



  In message <199806031839.SAA00231@iron.rcp.co.uk>you write:
  > I've done some investigations.
  > 
  > The problem as I understand is the biv's final exit value is
  > not always being set correctly when a loop is reversed.
  > 
  > The problem occurs when in biv's initial value is a
  > CONST_INT but not const_rtx0.
Yea, that was the first code I was going to look at, but you
beat me to it.


  > I've included a patch against egcs-19980531 snapshot which
  > I think corrects the problem.
  > 
  > I've done a "make bootstrap" on ix86-linux without problem.
  > 
  > Changelog Entry
  > 
  >  * loop.c (check_dbra_loop): Initialise final_value before
  >  normalizing loop.
It does.  I made a minor change.  Like your patch, the initialization
of final_value moves before loop normalization.  The difference is
your patch has:

	comparison_val = INTVAL (XEXP (comparison, 1));
	final_value = GEN_INT (comparison_val);

Mine has:

	final_value = XEXP (comparison, 1);

They're equivalent and it avoids creating unnecessary rtl :-)

Thanks!

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]