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

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

Re: [avr-gcc-list] Confusing static method RAM usage.


From: Marcin S
Subject: Re: [avr-gcc-list] Confusing static method RAM usage.
Date: Sun, 18 Dec 2011 15:31:53 +0000

There been some discoveries on this problem I want to share.

My main development plaform is Linux, as I posted before im using
gcc-4.5.3 there.
Out of curiosity I've installed WinAVR package on windows, built my
project and everything was ok with memory(!), means, RAM was not
bloated by using method in question.
Stable WinAVR using gcc-4.3.3 so I switched back to linux, installed
gcc-4.3.3 and after build memory usage was OK too.

Another test (focus now)
I replaced PanelPellet.o (file where problematic method is both
defined and used) in copy compiled with 4.3.3(good one)  with
PanelPellet.o from copy compiled on 4.5(bad one), then i linked whole
stuff again and memory gone wrong again.
So problem is definitly somewhere in that object file.

2011/12/17 Georg-Johann Lay <address@hidden>:
>Compile the code with -save-temps and read s-file carefully and you see where 
>the memory is needed.

Sorry, but I don't get any of what's in that files - but as  this
problem is now isolated to as single and quite short file, I can
provide both good and bad version




2011/12/17 Georg-Johann Lay <address@hidden>:
> Marcin S schrieb:
>
>> I never said this code does not compile.
>
>
> It's text in square brackets. It describes the snipped-out text rather then
> quoting all that lines.
>
>> using avr-gcc-4.5.3
>> build opts are:
>> avr-gcc -c -mmcu=atmega128 -x c++ -gdwarf-2 -DF_CPU=3686400UL  -Os
>> -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
>> -fno-exceptions -Wall -Wundef -ffunction-sections -fdata-sections
>> -Wa,-adhlns=OBJ/PanelPellet.lst -I. -IhrdDefs -ImyClasses  -MMD -MP
>> -MF .dep/PanelPellet.o.d PanelPellet.cpp -o OBJ/PanelPellet.o
>>
>> I prepared some related code snippets that should give You general
>> idea how its organized.
>> http://pastebin.com/96dWVww8
>> Yet, this example code compiling just fine and avr-size report 0 bytes
>> RAM used, just as it should.
>
>
> yup, the code is compiled to
>
> main:
> .L2:
>        rjmp .L2
>        .size   main, .-main
> .global panelObj
>        .section        .bss.panelObj,"aw",@nobits
>        .type   panelObj, @object
>        .size   panelObj, 1
> panelObj:
>        .skip 1,0
>
> So your memory leak is somewhere else, i.e. triggered by code you snipped
> out.
>
> Compile the code with -save-temps and read s-file carefully and you see
> where the memory is needed.



reply via email to

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