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]
Other format: [Raw text]

Re: Patch: fix SPEC regressions


> Why doesn't this test case fail on mainline?

Because of your patch on mainline:

2002-07-21  Richard Henderson  <rth@redhat.com>

	* loop.h (LOOP_AUTO_UNROLL): Rename from LOOP_FIRST_PASS.
	* loop.c (strength_reduce): Update.
	* toplev.c (rest_of_compilation): Do unrolling in the first
	loop pass, not the second.

On the 3.2 branch, we generate very bad code for

  for (i = 0; i < 4; i++)
    array[i] = 0;

on K6 at -O2 -funroll-loops: we first strength-reduce, which makes us lose the 
number of iterations, then unroll using the default number of iterations (8), 
which is later changed to 4 because we are preconditioning the loop. Then we 
generate a runtime calculation of the number of iterations really needed (!).

With your patch we unroll 4 times, period.

-- 
Eric Botcazou


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