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

preston@cs.rice.edu (Preston Briggs)
17 Mar 1996 23:20:47 -0500

          From comp.compilers

Related articles
[26 earlier articles]
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? john.r.strohm@BIX.com (1996-03-15)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cdg@nullstone.com (1996-03-15)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cdg@nullstone.com (1996-03-16)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? dan@watson.ibm.com (1996-03-16)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? stefan.monnier@lia.di.epfl.ch (Stefan Monnier) (1996-03-16)
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)
[17 later articles]
| List of all articles for this month |

From: preston@cs.rice.edu (Preston Briggs)
Newsgroups: comp.compilers
Date: 17 Mar 1996 23:20:47 -0500
Organization: Rice University
References: 96-03-006 96-03-091 96-03-106
Keywords: C, performance

Christopher Glaeser <cdg@nullstone.com> wrote:
>1) const - Granted, const is useful in situations where you want to
>inhibit stores and isolate potential errors at compile time. However,
>using const as a replacement for constant macros has performance
>penalties for many C compilers.


>2) static - Static can cause significant performance problems for many
>C compilers.


I have no doubts that Glaeser is correct, but I find this implied goal
of programming to the lowest common denominator very depressing. I'd
much prefer to see code written as cleanly as possible, using the
language as it should be used, not in a way dictated by the worst
compilers extant. 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.


If you buy a compiler that's supposed to generate good code, then you
should complain bitterly if it doesn't. Or buy from another source.
Or write your own.


Preston Briggs
--


Post a followup to this message

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