[Top][All Lists]

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

Re: [avr-gcc-list] code for 90s4433 is using SPH

From: Marek Michalkiewicz
Subject: Re: [avr-gcc-list] code for 90s4433 is using SPH
Date: Sun, 23 Feb 2003 18:14:52 +0100
User-agent: Mutt/1.4i

> Strange.  Than i'd say that -mtiny-stack doesn't work as announced.

That's because -mtiny-stack can be used on devices with SPH, too.
SPH is initialized at startup, and never changed later.  This is
fine if we know the stack fits within a 256-byte aligned page.

Stack is initialized in gcrt1.S (before calling constructors),
and SPH is only written there if present in the target device,
so it is not really necessary to initialize SP again in main().
Perhaps for GCC 3.4 it would be good to make main() a normal
function (currently it is handled specially) - it would cost
2 bytes of SRAM for return address on stack, but that's not as
important today as it was a few years ago...

If main() never returns, the user can specify the "noreturn"
attribute to avoid saving any registers (waste of stack space).
Perhaps a new attribute would be useful - "this function can
return, but it's OK to clobber all registers, no need to save
anything".  It's called "OS_Task" in the h8300 port, but not
documented anywhere - should we use the same name?  Is this
the same thing as "__C_task void main(void)" in IAR C code?


reply via email to

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