Vectorizing C compiler for the Cray

Radford Neal radford at calgary.UUCP
Mon Apr 8 13:59:17 AEST 1985


>A committee at LLNL has studied the language and its suitability for numerical
>work and is implementing the full C language with one minor modification.
>In order to have compatibility with Fortran all subroutine parameters will
>be passed by address. A small price to pay for good floating point performance
>don't you think?

> (Insert lots of comments posted about the resulting language not being C.)

The reaction to this MAY be premature. One could write a C compiler which
passed parameters by the address of a temporary location which has been
set to the value of the actual parameter. I.e. the call

    fred(x,1);

would be compiled as

    t1 = x;
    t2 = 1;
    fred(&t1,&t2);

Assuming corresponding dereferencing when the parameter is accessed, this
is just a rather inefficient way of implementing call-by-value and would
not make the language "not C".

This might be justified by the ability to call a FORTRAN routine like

    fred(x,1);

without having to manually convert it to

    t = 1;
    fred(&x,&t);

and without having to declare it as being a special FORTRAN routine. Of
course, this only works if the FORTRAN routine doesn't return information
in its parameters (i.e. if it is essentially treating parameters as
call-by-value). This would be true of many numerical routines (e.g. SQRT).

Of course, if this ISN'T what the original poster meant, I would certainly
agree that the language isn't C.

    Radford Neal
    The University of Calgary



More information about the Comp.lang.c mailing list