A branch too far

guy at gorodish.UUCP guy at gorodish.UUCP
Mon Feb 9 10:05:02 AEST 1987


>PCC operates on the WYSIWYG principle.

I wouldn't go that far.  The fact that it assigns registers in a
particular order is NOT a deliberate feature, and implementors are
completely free to change its behavior.

>Also, parts of the kernel depend on the predictability of PCC (boot
>parameters are passed in a register).

Parts of *some* kernels, please!  *Our* kernel passes them as
strings.

The fact that some parts of the kernel depend on this is irrelevant,
and cannot be used to require that compilers do only simple-minded
register assignment.  When this sort of stuff is necessary, it
*should* be done via some sort of pragma.  ANSI C has a #pragma
control line for just this sort of thing.  You could modify your
compiler (even if you don't implement all of ANSI C) to permit things
like

	#pragma	use_register	variable_in_r0	r0

>When optimization really does matter one should use a commercial C
>compiler such as Tartan cc.

Or add an optimizer to a PCC-based compiler, as has been done at various
places.  (The 4.[23]BSD FORTRAN optimizer, and Sun's FORTRAN
optimizer, slide in between the first pass of "f77" and the PCC-based
FORTRAN code generator.)



More information about the Comp.lang.c mailing list