Re: C code .vs. Assembly code for Microcontrollers/DSPs ?

cdg@nullstone.com (Christopher Glaeser)
21 Mar 1996 23:45:47 -0500

          From comp.compilers

Related articles
[31 earlier articles]
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? albaugh@agames.com (1996-03-16)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? preston@cs.rice.edu (1996-03-17)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? elvey@hal.com (1996-03-17)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? john.gilliver@gecm.com (1996-03-20)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? leichter@smarts.com (Jerry Leichter) (1996-03-21)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? stefan.monnier@lia.di.epfl.ch (Stefan Monnier) (1996-03-21)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cdg@nullstone.com (1996-03-21)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? pdonovan@netcom.com (1996-03-21)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? fjh@cs.mu.OZ.AU (1996-03-21)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cliffc@ami.sps.mot.com (1996-03-21)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? schwarz@mips.complang.tuwien.ac.at (1996-03-22)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? jfc@mit.edu (1996-03-22)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? chuck@aage.mit.edu (1996-03-22)
[12 later articles]
| List of all articles for this month |

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


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.