I forget what it was originally called.
Walter Murray
walter at hpcllz2.HP.COM
Sat Mar 12 08:37:39 AEST 1988
> Which brings me to another question: How good are compilers these
> day? Can they optimize just as well as a programmer (without
> resorting to assembly, that is) or not? For example:
>
> A)
> temp = {expression}
> a[temp] = 1;
> b[temp] = 2;
> c[temp] = 3;
> B)
> a[temp={expression}]=1;
> b[temp]=2;
> c[temp]=3;
> C)
> a[{expression}]=1;
> b[{expression}]=2;
> c[{expression}]=3;
> D)
> {
> register temp;
> temp = {expression};
> .
> .
> .
> }
I tried these on the HP C compiler on an HP 9000 Series 800
and (with optimization turned on) got the same code for all
four approaches.
Walter Murray
More information about the Comp.lang.c
mailing list