loop optimizations

Marko Mlinar markom@opencores.org
Fri Jan 25 02:42:00 GMT 2002


Hello !

I have a short question:
Is gcc 3.1 capable of convesion classical loops with simple iterators, e.g.

int a[50], b[50], i;
for (i = 0; i < 50; i++)
  {
     a[i] = b[i];
  }

to more optimized code that uses test like instructions:
i = 49;
while (i != 0) /* Test instruction used */
  {
    a[i] = b[i];
    i--;
  }

thanks,
  Marko




More information about the Gcc mailing list