[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] WinAVR - gcc 3.4.6 - AVR Studio - DuoCore PC - Stackp
From: |
Steffen Rose |
Subject: |
Re: [avr-gcc-list] WinAVR - gcc 3.4.6 - AVR Studio - DuoCore PC - Stackpointer problem |
Date: |
Mon, 27 Nov 2006 09:23:43 +0100 |
User-agent: |
KMail/1.9.1 |
Hello,
On Saturday 25 November 2006 23:15, Joerg Wunsch wrote:
> Steffen Rose <address@hidden> wrote:
> > wrong code:
> > PUSH R17
> > PUSH R28
> > PUSH R29
> > IN R30,0x3D
> > IN R31,0x3E
> > SUBI R30,0x4A
> > SBCI R31,0x10
> > STD Z+0,R1
> > LDS R24,0x500
> > TST R24
> > BREQ PC+0x03
> > CALL 0x12A
> >
> > The Subtraction 0x104A from the Stackpointer is very high.
>
> That would suggest you've been declaring a *lot* of local
> variables.
>
> Is this perhaps without optimization (-O0), and the other case
> uses optimizations? In that case, it's possible the compiler
> optimized all your local variables away because they are not
> needed. But still, the error is in your code if you are
> trying to reserve more variables than you've got RAM (stack in
> that case) available.
That's not so simple. It's a function without parameters and only
two pointer and a unsigned char local variable. In both cases
the Optimization is -Os -mcall-prologues.
Is it possible to see all used options within the listing files?
I'm not sure, if the options, that I see in the AVR studio
command line are all used options. Within the *.i and *.s files
the used options are not included. :-(
Do the avr-gcc know an optimization, that the stack frame for all
called functions are created within the first called function?
Thank you for your ideas.
--
Regards
Steffen Rose