volatile isn't necessary, but it's

mcdonald at uxe.cso.uiuc.edu mcdonald at uxe.cso.uiuc.edu
Sun Apr 17 01:10:00 AEST 1988


>>In article <7794 at alice.UUCP> dmr at alice.UUCP writes:
>>Has anyone else noticed that a lot of the more peculiar things that X3J11
>>has added (volatile, and especially noalias) are there for the
>>benefit of compiler writers and benchmarkers, and not for the user?
...........

>It seems the compilers are now doing things like unrolling loops with
>constant bounds, and generating in-line code for what are supposed to
>be library routines, like strcpy and memcpy.  This makes for much
>faster benchmarks, but makes large (source) programs generate such
>large object files that they no longer fit in the target systems'
>memory space.


I think it HIGHLY desirable that compiler vendors provide the tools to get
the fastest running programs! I and my students get tired of waiting
30 minutes to hours for some program to run! The MS-DOS compiler business
has gotten so competitive that the users are being well served indeed!
In the Microsoft case, you've got /Ox (breaks quite a bit of code because
they haven't implemented "noalias" :-)  ) which is equivalent to
    /Oailt /Gs, which implements, in order, optimizations unsafe in 
the presence of aliases, inline expansion of certain things, loop
optimizations, and general optimization for fastest time, plus
the /Gs to remove run-time stack checking. On the other hand, they
have /Os, which optimizes for smallest size (but only makes a small
difference).  The BIGGEST gain in speed in some cases also reduces size:
/Gc, which changes to globally using a more efficient calling convention,
but also requires declaring certain thing with the "cdecl" keyword,
which in turm starts another religious war in "comp.lang.c" :-) :-)
     I think that these people should be congratulated, not pilloried!

Doug McDonald



More information about the Comp.lang.c mailing list