avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] avr-gcc bug: global register variable is broken


From: Klaus Rudolph
Subject: [avr-gcc-list] avr-gcc bug: global register variable is broken
Date: Wed, 1 Dec 2004 15:48:42 +0100 (MET)

Hi all,

it is impossible to define a global register variable in avr-gcc.
The register is used by the compiler on some places and it is really not
preserved.


The actual gnu documentation says:
"Defining a global register variable in a certain register reserves that
register entirely for this use, at least within the current compilation. The
register will not be allocated for any other purpose in the functions in the
current compilation. The register will not be saved and restored by these
functions. Stores into this register are never deleted even if they would
appear to be dead, but references may be deleted or moved or simplified."

I know that it is not ok to call to LIBRARY functions, but it is allowed to
use
all functions which are compiled with the knowledge of the reserved
register.
As a hint the documentation says that it is allowed to recompile all used
library functions with -ffixed-reg option to preserve the register for
use. 

The bug is:
It is not possible to define a global register variable because it is used
from
ompiler.
It is impossible to preserve the register with -ffixed-reg option.

Any idea for a workaround? I need some register vars for interrupt handler
:-(

Is there allready a patch available or is this maybe fixed in current CVS
head of release 4.0 in gcc sources?

Thanks
    Klaus






-- 
Geschenkt: 3 Monate GMX ProMail + 3 Top-Spielfilme auf DVD
++ Jetzt kostenlos testen http://www.gmx.net/de/go/mail ++


reply via email to

[Prev in Thread] Current Thread [Next in Thread]