This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: loop-iv bugfix
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Bernd Schmidt <bernds_cb1 at t-online dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 25 Feb 2007 19:10:56 +0100
- Subject: Re: loop-iv bugfix
- References: <45E068C3.9040408@t-online.de>
Hello,
> This fixes a bug I discovered while working on the previous patch to
> improve upper bounds for the number of iterations. When searching
> backwards through the insns to simplify an expression, loop-iv keeps
> track of which registers have been altered, but it does not reliably
> take this information into account. Whenever a register that appears in
> the expression has been altered, we must abort the scan.
>
> Bootstrapped & regression tested on i686-linux, as well as numerous
> times in our Blackfin tree. Committed as 122291.
this looks a bit conservative, but I guess it does not make sense to
make this code more complicated unless someone comes with some testcase
that would require it.
> Index: loop-iv.c
> ===================================================================
> --- loop-iv.c (revision 122288)
> +++ loop-iv.c (working copy)
> @@ -1811,6 +1811,8 @@ simplify_using_initial_values (struct lo
> FREE_REG_SET (altered);
> return;
> }
> + if (for_each_rtx (expr, altered_reg_used, altered))
> + return;
FREE_REG_SET (altered); is missing here.
Zdenek