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

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

Re: [avr-gcc-list] Stack use - possible bug


From: Jan Waclawek
Subject: Re: [avr-gcc-list] Stack use - possible bug
Date: Wed, 9 Jun 2010 15:41:05 +0200

The same here, although without inlined functions (or at least I am not aware 
of them).

In a large (generated) main(), stack grew to >600 bytes (which results in 
costly access to local variables, as the Y+d could not reach them), in spite of 
all local variables having strictly confined scope to disjunct blocks.

I could not produce a simple testcase either, that's why I never reported it as 
a bug.

Jan Waclawek



----- Original Message ---------------
>Dale wrote:
>> Hi                                  >@2010.06.09_14:42:49_+0200
>> 
>> Here's some code which shows this.
>
>This code doesn't show a real bug, because even if the initialize
>function weren't inlined, the stack would have to grow when calling it.
>If you have enough RAM to support that, you have enough RAM to support
>it being left there.
>
>The real bug comes from gcc not reusing that space for other variables
>afterwards, or calling other functions that might need that space
>without releasing it first.
>
>For instance, if you have another array in main but don't use it until
>after you've called initialize, gcc should reuse the same space for the
>main array too and not use 100 bytes of stack.
>
>Sometimes this doesn't work correctly, but I wasn't able to produce a
>simple case to show this problem (only very complex programs which I
>didn't want to post online). :(




reply via email to

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