avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] [bugs #4101] setjmp/longjmp destroy changes in global


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [bugs #4101] setjmp/longjmp destroy changes in global registers
Date: Mon, 7 Feb 2005 20:53:02 +0100
User-agent: Mutt/1.4.2.1i

As Paul Schlie wrote:

> - yes and no, asm routines would need to manually exclude their use,
> compiled code would automatically use them or not depending on if
> the registers were declared as being reserved or not at compile
> time.

But only if you recompile the entire library together with your own
sources.  I haven't heard of anyone else but you who even considered
that a useful feature.

> > But again, no additional problems for asm sources, they just had
> > to follow the very same ABI only.

> - yes. (as long as it defines a hole in the caller-saved register
> set which asm routines were excluded from being able to use).

I didn't make an exhaustive test, but so far, I think none of the asm
code ever uses r2 through r5, so these would be fine candidates (but
only if you also recompile all the C library functions).  It's kinda
recommended practice to start allocating global register variables at
r2 anyway, as the compiler tends to allocate registers ``top down''.

As you're the only one requesting this, I wouldn't want to make this a
formal committment to the ABI though.

Of course, back to the subject, *if* you recompile the entire library
with your own compiler switch preventing the compiler from ever using
some register, then just go ahead, and also edit setjmp.S accordingly.
That should be a trivial job for anyone who considers linking against
their own specific compilation of the library.  By this, you've simply
chosen to run your own ABI which might be fine for you, even though
it's nothing the majority of the users would consider useful -- after
all, that's why you've got the source code.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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