On 2011-05-21, Gerhard Fiedler <> wrote:
> Jonathan de Boyne Pollard wrote:
>>> In the microcontroller world, the big performance hits come from the
>>> fact that the only available compilers are for C and sometimes C++.
>>> (And nobody uses assembly language except for the very little jobs.)
>>> The nature of the C language prevents compilers from doing
>>> optimisations that are standard in compilers for high-level
>>> languages. Most C compilers will, for example, always pass
>>> parameters on the stack, despite the generous supply of registers
>>> available in newer hardware.
> I'm not sure this is a limitation of the C language.
It's not. It's not even true of C. It may be true of some ABIs, but
I have seen plenty which regularly use registers in their calling conventions.
> Also, some C compilers do "whole program optimization" and with that can
> tailor the calling code to the called code. There doesn't seem to be
> anything in the C language spec that prohibits such things.
There's not. Modern optimizations are pretty good.
I don't see any evidence to suggest that these are serious performance
hits.
-s
--
Copyright 2011, all wrongs reversed. Peter Seebach /
usenet-
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.