low level optimization

Blair P. Houghton bhoughto at bishop.intel.com
Fri Apr 19 14:21:54 AEST 1991


In article <21868 at lanl.gov> jlg at cochiti.lanl.gov (Jim Giles) writes:
>I don't understand why you continue to hang on like grim death
>to the fiction that dependent compilation satisfies the requirements
>of the standard.

I haven't seen anyone state such a thing.  What I have
seen is plenty of statements that equate to the standard's
requirement that a conforming program be translatable by
a conforming implementation into a form that can be used
to produce the output associated with a given input.  It's
just tough luck if this prevents you from expecting
a certain optimization to be applied when you compile
in strictly conforming mode.

This has absolutely no effect on the form of the code in
the source files.  Exactly the opposite.  It provides for
the desired state where a program can be translated on any
number of machines without alteration of the source files.

If, however, it's provided you with extensions that allow
you to produce odd effects, and you use them, then you
are exceeding the bounds of the standard's influence, and
whatever is required by the extension you must obey or
it just won't work, apparently.  This still has no
effect on the source code.  You haven't stated that
special syntax must be provided in the source files
in order to use this optimization you so desire, so
there's no reason that my strictly conforming compiler
that doesn't optimize in this way and your specialized
compiler that does optimize in this way shouldn't be
able to produce the same output.

You're so hyped up about the fact that separate compilation
prevents use of this optimization, but you haven't been
so vocal about the case where you deliberately alias one
of your arrays, which also blows your optimization.

If you want to go out of your way, you have to go out of your way.

				--Blair
				  "If the implementation also has
				   knobby tires, a half-fairing, and a
				   bottle of diethyl ether, then it's
				   also an offroad crotch-rocket, but
				   it better do the -ansi thing for
				   `main(){printf("Hello, world.\n");}'"



More information about the Comp.lang.c mailing list