Zdenek Dvorak - Re: loop-iv bugfix (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]
Other format: [Raw text]

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


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