C question
VLD/VMB
gwyn at Brl-Vld.ARPA
Fri Apr 12 02:31:22 AEST 1985
The compiler is perfectly within its rights in making
x = 5;
x = x++;
result in x==5 sometimes and x==6 other times. This
is one of the implementation-dependent aspects of the
C language, intended to allow better overall code
generation. You should not write such source code.
If there is a
movl r11,r11
in your output, then you must not have invoked the C
optimizer (cc -O option). To make code generation
easier and more reliable, the main compiler relies
on the optimizer to clean up such things.
More information about the Comp.lang.c
mailing list