From: | cdg@nullstone.com (Christopher Glaeser) |
Newsgroups: | comp.compilers |
Date: | 21 Mar 1996 23:45:47 -0500 |
Organization: | Compilers Central |
References: | 96-03-006 96-03-091 96-03-106 96-03-117 |
Keywords: | C, performance |
Preston Briggs <preston@scs.rice.edu> writes:
> I find this implied goal of programming to the lowest common
> denominator very depressing.
Since the majority of C compilers do not optimize const or static,
"loweset common denominator" is perhaps better described as "common
denominator".
> If you're using a compiler that has such problems
> (with const, say), you probably shouldn't expect much in the way of
> performance no matter how carefully you contort your code.
This is not consistent with my observations. Consider the following code
fragment:
const int ZERO = 0;
void f (void) { if (ZERO) g{}; }
Analysis of several dozen C compilers suggests the following. If a
compiler can optimize this code fragment, then it probably has a good
optimizer. However, failure to optimize this code fragment says
little about the other optimizations a compiler can support.
Regards,
Christopher Glaeser cdg@nullstone.com
Nullstone Corporation http://www.nullstone.com
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.