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

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

AW: AW: [avr-gcc-list] avr-gcc bug: global register variable isbroken


From: Haase Bjoern (PT-BEU/MKP5) *
Subject: AW: AW: [avr-gcc-list] avr-gcc bug: global register variable isbroken
Date: Thu, 2 Dec 2004 09:34:39 +0100

I have had a brief look at the register allocation for variables yesterday:

- The register allocation starts at r24:r25 for the first function parameter 
and for each additional
parameter it seems that the register number is simply decreased as long as r10 
is reached.
There is no code that could handle "holes" within the register range r10 ... 
r25 that would be
generated by additional registers declared "fixed".

I come to the conclusion, that the best solution for your problem is probably 
the follwing:

1.) Get the sources of gcc
2.) Learn to build the compiler yourself
3.) Change 3-4 source lines in order to tell the compiler, e.g. to pass 
parameters only in the
register range r25:r18. You will nead to incorporate the changes in

avr.h :

Change the tables for declaring fixed registers to include your global register 
variables.

avr.c :

Change the #define symbols that specify the first register and last register 
for parameter passing 
that are used by the function "funct_arg".

Yours,

Björn 

-----Ursprüngliche Nachricht-----
Von: address@hidden
[mailto:address@hidden Auftrag von Klaus Rudolph
Gesendet: Donnerstag, 2. Dezember 2004 07:56
An: Dmitry K.
Cc: address@hidden
Betreff: Re: AW: [avr-gcc-list] avr-gcc bug: global register variable
isbroken


Hi Dmitry,

> I have translated this example with an option '-ffixed-r9' (3.3.4). In the
> received code I have not found mistakes, the reserved register is not
> used. 
> Reduce, please, an example and specify a mistake more precisely.

The error occures if register is from r11 and higher ones is used. 
If register r10 is fixed the code uses r10 without initialisation whithin my
example.
To reduce the example is not possible I think because we need a called 
function which sould be called from not main and must use nearly all
registers.
So the send example is the shortest I have actually.
Maybe I can present a better one next days.

Regards,
    Klaus



-- 
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis!

_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list



reply via email to

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