Highly Optimizable Subset of C (was: Fortran vs. C for numerical work)

Henry Spencer henry at zoo.toronto.edu
Sun Nov 25 14:11:00 AEST 1990


In article <1990Nov24.201731.3442 at cunixf.cc.columbia.edu> shenkin at cunixf.cc.columbia.edu (Peter S. Shenkin) writes:
>The difficulty of optimizing C comes from C features (pointers) absent
>in Fortran.  It has been observed that C programs translated from Fortran
>using f2c run about as fast as the Fortran versions, which seems to imply that
>(1) such translations do not use the problematic C features, and (2) if
>the probematic C features are avoided, C compilers optimize about as well
>as Fortran compilers...

Actually, I think it is more a reflection of the low quality of the compilers
most of us use.  I don't think f2c makes any attempt to avoid trouble, given
that things like passing pointers to arrays are among the problematic areas,
and this is everywhere in any array-using program.  A really good Fortran
compiler, told to shoot for the Moon on optimization, should consistently
outdo a similar C compiler working from an f2c translation.
-- 
"I'm not sure it's possible            | Henry Spencer at U of Toronto Zoology
to explain how X works."               |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list