Xref: utzoo comp.lang.fortran:4126 comp.lang.c:34205 Newsgroups: comp.lang.fortran,comp.lang.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: Highly Optimizable Subset of C (was: Fortran vs. C for numerical work) Message-ID: <1990Nov25.031100.6211@zoo.toronto.edu> Organization: U of Toronto Zoology References: <1990Nov22.051446.1871@ccu.umanitoba.ca> <1990Nov23.181209.26366@zoo.toronto.edu> <1990Nov24.201731.3442@cunixf.cc.columbia.edu> Date: Sun, 25 Nov 90 03:11:00 GMT In article <1990Nov24.201731.3442@cunixf.cc.columbia.edu> shenkin@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@zoo.toronto.edu utzoo!henry