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

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

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


From: Klaus Rudolph
Subject: Re: AW: [avr-gcc-list] avr-gcc bug: global register variable isbroken
Date: Wed, 01 Dec 2004 18:20:44 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.6) Gecko/20040114

Bernard Fouché schrieb:

Is it normal that 'y' being a long, it is given to f1() even for 'g' and 'h'
parameters?

It is normal and must automaticly casted to target size. This is not normal code which I use :-))) This is only an example which shows that the global register definition is broken.

Maybe there is a way to avoid using particular registers for your
application? If the code that you show is like the one you use in your
interrupt handler and if you want to use a specific register because of
performance, calling a function from an interrupt handler (and a function
with so much parameters than many registers will be touched or the stack
frame will have to be calculatedd) will use code space and processing time.
I would not use such functions in my interrupt handler. But it is possible that such functions appear in the "normal" non interrupt code. And if this code breaks my registers it is simply wrong.


If the problem is not performance but only to call some particular function
requiring specific register usage, why not write a few assembly lines to
save/restore the corresponding registers?

This needs time! Lots of time for a really frequent called irq-handler. And in my case, the irq handler do the most work and the "application level" must do nothing fast and it is acceptable that there are only 10 registers which are used in the "main" part of my software. OK, this is maybe a hard requirement, but for other targets this is possible and I think it makes no sense to discuss if this makes sense or not. I think if the compiler give this options we should look that this options could be used. If not, we should
give an error message or remove this options at all.

I will not continue discussions about what else could be done. I simply hope that it will be accepted that this is a bug and I hope this bug could be fixed and!!!! the fix goes to the sources :-) If it will be accepted that this is a bug I am maybe able to look for it. I fixed "my" binutils problem last week and maybe I also could fix this. But it make no sense
to spend a lot of time if the potential pact will never used anywhere.

regards
  Klaus



reply via email to

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