This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [egcs-19980531] Optimization bug pe
- To: grahams at rcp dot co dot uk
- Subject: Re: [egcs-19980531] Optimization bug pe
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 04 Jun 1998 00:59:40 -0600
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
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