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

schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz)
22 Mar 1996 00:04:05 -0500

          From comp.compilers

Related articles
[35 earlier articles]
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)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? preston@tera.com (1996-03-22)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? bobduff@world.std.com (1996-03-22)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? torbenm@diku.dk (1996-03-25)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) (1996-03-25)
[8 later articles]
| List of all articles for this month |

From: schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz)
Newsgroups: comp.arch,comp.compilers,comp.dsp
Date: 22 Mar 1996 00:04:05 -0500
Organization: TU Wien
References: 96-03-006 96-03-091 96-03-111
Keywords: optimize, performance

The moderator writes:


| [...] are there still compilers that pay attention to register? -John


Perhaps someone can help me here. I always thought that the
main benefit of register in modern compilers is that it asserts
that the variable isn't aliased, since its address cannot be taken;
and not that the object should be held in a register during
its entire lifetime.


As far as I understand ANSI C, as soon as a char * pointer appears
in a function, any (non-register) object may be aliased by it.


In any case, the register keyword makes it immediately obvious to
the human reader that the variable is not aliased; it can be
used as documentation just like const.


Konrad Schwarz
[If you have an auto variable and never take its address, it can't be
aliased. Register does document your intent, but it doesn't tell the
compiler anything it can't figure out anyway. -John]




--


Post a followup to this message

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