C "optimization" (8 of 8)

Kenneth Almquist ka at hou3c.UUCP
Wed Feb 22 12:47:11 AEST 1984


This example also shows what is really a bug in the C compiler.  After
executing the assignment, it (unnecessarily) takes the value of *(a->p->p).
The System V compilers for the VAX and the 3B20 do the same thing.
					Kenneth Almquist


P. S.  For those of you who don't have the original article, the C code was:
typedef struct dp *DP;
struct dp {
    int d;
    DP  p;
    }

test(a)
DP a;
{
    a->p->p->p->d =
 	a->p->p->p->p->d;
}



More information about the Comp.lang.c mailing list