This is the mail archive of the gcc-help@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] | |
On 07/26/2011 11:35 AM, Andrew Haley wrote:I tried your example. It doesn't make an induction variable because it can do i*2 with the LEA instruction at no extra cost. With i*11 it makes two counters:
Consider
for (i = 0; i< limit; i++) f(i * 2);
which can be rewritten to
int tmp = limit * 2; for (i = 0; i< tmp; i += 2) f(i);
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |