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

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

Re: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjump


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather thanjumping to it
Date: Tue, 13 Feb 2007 20:59:34 +0100
User-agent: Mutt/1.5.11

As Eric Weddington wrote:

> Joerg, what do you think of this? Time to revisit the atmega256x
> patch?

Well, maybe.

I suggest we change gcrt1.S anyway: if we are not going to place the
additional infinite loop behind itx, the only cost for doing so is a
single CALL/RCALL plus the two (or three for the ATmega256x) bytes on
the stack.  As we already do have compilers around right now that
treat main() as a normal function, this would simply get us onto the
safe side avr-libc-wise.

In general, I agree with Anatoly's argumentation.  However, I believe
the C standard would require main() to be callable, so ideally the
treatment of main() should be an option, and it should even default to
being enabled (like we do for -mint8, although the consequences aren't
so drastic as in the -mint8 case).  In case we should ever implement
64-bit floats, I'd also like to see them being the default (for
standards conformance reasons), with some option (say, -mdouble32)
to revert to the current behaviour.

Btw., part of treating main() as a normal function was to remove the
obsolete initialization of the stack pointer at the beginning of
main()(when it's actually being already initialized early in .init2).
I don't know whether that's alredy default GCC behaviour, or also came
from Bjoern's ATmega256x patch.

Also, we should certainly ask Bjoern for any comments.

-- 
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]