------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-30 01:12 ------- Here is the .optimizate dump for -fno-ivopts (the most optimial code): { <bb 0>: if (w > 63) goto <L0>; else goto <L2>;
<L0>:; *(long long unsigned int *) d = 0; *(long long unsigned int *) (d + 8B) = 0; *(long long unsigned int *) (d + 16B) = 0; *(long long unsigned int *) (d + 24B) = 0; *(long long unsigned int *) (d + 32B) = 0; *(long long unsigned int *) (d + 40B) = 0; *(long long unsigned int *) (d + 48B) = 0; *(long long unsigned int *) (d + 56B) = 0; w = w - 64; d = d + 64B; if (w > 63) goto <L0>; else goto <L2>; <L2>:; return; } (just like what is in the source, one iv). The tree dump for ivopts is still on (well the inner loop to show the problem): <L0>:; *(long long unsigned int *) d.19 = 0; *ivtmp.10 = 0; *ivtmp.11 = 0; *ivtmp.12 = 0; *ivtmp.13 = 0; *ivtmp.14 = 0; *ivtmp.15 = 0; *ivtmp.16 = 0; d.19 = d.19 + 64B; ivtmp.10 = ivtmp.10 + 64B; ivtmp.11 = ivtmp.11 + 64B; ivtmp.12 = ivtmp.12 + 64B; ivtmp.13 = ivtmp.13 + 64B; ivtmp.14 = ivtmp.14 + 64B; ivtmp.15 = ivtmp.15 + 64B; ivtmp.16 = ivtmp.16 + 64B; if ((int) ((unsigned int) w + (unsigned int) d - (unsigned int) d.19) > 63) goto <L0>; else goto <L2>; Some times is better to use only one IV especially for a manually unrolled loop which is what this loop is. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19701