Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: low level optimization Message-ID: <15881@smoke.brl.mil> Date: 18 Apr 91 05:35:21 GMT References: <21527@lanl.gov> <15870@smoke.brl.mil> <21660@lanl.gov> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 47 In article <21660@lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes: -All array arguments to a procedure must be assumed aliased to each -other and to any globals of the same base type. No, this is not true (assuming you are talking about pointer arguments; C does not have array arguments). As I and others have recently told you, sometimes this must be assumed and other times it need not be, depending on context. -Indeed, due to the fact that most C programmers violate the rules -prohibiting type casts of pointers to different types, all arrays -should be assumed aliased to globals and other pointers of _any_ -type. We know you're a Fortran bigot, but that's ridiculous. -|> I wasn't particularly referring to array-intensive applications -|> anyway, because most interesting "scientific" applications that -|> I have encountered require more flexibility than the use of fixed -|> arrays provides. Each language should be dealt with on its own -|> terms, not treated as an inferior substitute for one's favorite -|> language. -Then you shouldn't make unqualified statements that are not true. -Your claim was that C was inherently as fast or faster than Fortran -for all operations (you made the exception of _old_ C implementations -that forced double computation instead of float). To now say that you -weren't including array-intensive applications is a little late. You have this annoying habit of pretending I said things that I didn't. I didn't EXCLUDE array operations in the statement sited above, and I didn't say that C was inherently as fast as Fortran for all operations. What I said was: ->>> I don't think that is the proper explanation of the observed phenomenon. ->>> For any commercial-quality system, I would be amazed if an equally ->>> competent implementation of nearly any algorithm in Fortran and C gave ->>> much edge to Fortran. The one possibility for a significant speed ->>> difference of which I am aware is the requirement for pre-ANSI C that ->>> all floating-point computations be performed in double precision, even ->>> if the variables are declared as single-precision. Standard C discards ->>> that old requirement. I don't see any point in continuing to argue with you, any more than the last time you stuck your nose into the C newsgroup to run down the language and promote Fortran for everything. If you want a more complete picture of the "aliasing problem" in C, you should read some of the papers from NCEG. "A little knowledge is a dangerous thing."