On Fri, 2004-03-26 at 15:16, Vladimir N. Makarov wrote: > John Lu wrote: > > >Hi, > > > >I've been working on a port based on gcc-3.3 and I've noticed that > >better assembly code is generated if the C source has > >separate variables declared for distinct live ranges. > > > > > > > Pesudo-register renaming is made by -fweb. It was written by Jan > Hubicka. Probably, this option should be set up by default (although > there is no practically improvement for SPECInt2000 for P4, some tests > are really faster). Another positive thing of usage this option is > better scheduling because of less anti-dependences. > tree-ssa will be doing this type of thing automatically shortly. Its a one line patch to enable it. (attached). I haven't turned it on yet because it can make a real mess of the debug information and we'd like to fix that :-). Andrew PS. tree-ssa optimizes that program to: foo1 (p1, p2) { int i.15; int total; int i; : total = 0; i = 0; :; total = *((int *)((unsigned int)i * 4) + p1) + total; i = i + 1; if (i <= 99) goto ; else goto ; :; i.15 = 0; :; total = *((int *)((unsigned int)i.15 * 4) + p1) + total; i.15 = i.15 + 2; if (i.15 <= 99) goto ; else goto ; :; return total; }