Re: [Mspgcc-users] variable reusing

2013-05-23 Thread Alex Orange
Correct, I am unsure whether gcc does any sort of static re-use analysis or not. I was just getting the feeling that you were saying that GCC doesn't do any sort of whole-program analysis and wanted to clarify that part. On Thu, May 23, 2013 at 2:41 AM, David Brown wrote: > On 22/05/13 19:30, A

Re: [Mspgcc-users] variable reusing

2013-05-23 Thread David Brown
On 22/05/13 19:30, Alex Orange wrote: > Isn't that exactly what LTO of the new GCC versions does. I have no idea > whether mspgcc supports it, though I would guess it might. My understanding > is that GCC LTO works by just storing the GIMPLE trees in the object files, > stitching them together at l

Re: [Mspgcc-users] variable reusing

2013-05-22 Thread Alex Orange
Isn't that exactly what LTO of the new GCC versions does. I have no idea whether mspgcc supports it, though I would guess it might. My understanding is that GCC LTO works by just storing the GIMPLE trees in the object files, stitching them together at link time and generating code from the stitched

Re: [Mspgcc-users] variable reusing

2013-05-15 Thread Matthias Ringwald
Hi C isn't well suited for this kind of reasoning (when is what memory being used). Here's the dissertation of a friend of mine on how to use state charts or so to get there: http://e-collection.library.ethz.ch/view/eth:29949 (I assume/hope there enough arguments and options listed in there) B

Re: [Mspgcc-users] variable reusing

2013-05-15 Thread David Brown
What compiler flags did you use? It sounds to me that you are compiling without enabling optimisation - in which case you can't expect good code. mvh., David On 14/05/13 20:01, kuldeep dhaka wrote: > hello guys, > > while coding (embedded devices) i got an idea. > > void uart_send_param(uin

Re: [Mspgcc-users] variable reusing

2013-05-15 Thread David Brown
On 15/05/13 08:30, A.P. Horst wrote: > > On 15-5-2013 0:31, Paul Sokolovsky wrote: >> Hello, >> >> On Wed, 15 May 2013 09:35:14 +1200 >> Daniel Beer wrote: >> >>> On Tue, May 14, 2013 at 09:26:46PM +0300, Paul Sokolovsky wrote: More interesting question is such support for static (if not glo

Re: [Mspgcc-users] variable reusing

2013-05-15 Thread William "Chops" Westfield
> > you really wish that compiler could "pack" together static buffers of > functions which cannot be active at the same time At some point, you might as well just allocate a global array called "buffer" and use it everywhere. You could even add some checking code to make sure no one else is

Re: [Mspgcc-users] variable reusing

2013-05-14 Thread A.P. Horst
On 15-5-2013 0:31, Paul Sokolovsky wrote: > Hello, > > On Wed, 15 May 2013 09:35:14 +1200 > Daniel Beer wrote: > >> On Tue, May 14, 2013 at 09:26:46PM +0300, Paul Sokolovsky wrote: >>> More interesting question is such support for static (if not global) >>> variables. When trying to do Elliptic C

Re: [Mspgcc-users] variable reusing

2013-05-14 Thread Wayne Uroda
Would either of these solutions work?: - use a scheme like Malloc/free to allocate the buffers when you need them - allocate the buffers on the stack (is there a practical limit to doing this?) and that way they can be recycled when not in use The terrible downside with stack based allocation is

Re: [Mspgcc-users] variable reusing

2013-05-14 Thread Paul Sokolovsky
Hello, On Wed, 15 May 2013 09:35:14 +1200 Daniel Beer wrote: > On Tue, May 14, 2013 at 09:26:46PM +0300, Paul Sokolovsky wrote: > > More interesting question is such support for static (if not global) > > variables. When trying to do Elliptic Curve Cryptography on MSP430 > > value line devices w

Re: [Mspgcc-users] variable reusing

2013-05-14 Thread Daniel Beer
On Tue, May 14, 2013 at 09:26:46PM +0300, Paul Sokolovsky wrote: > More interesting question is such support for static (if not global) > variables. When trying to do Elliptic Curve Cryptography on MSP430 > value line devices which top up at 0.5K RAM, you really wish that > compiler could "pack" to

Re: [Mspgcc-users] variable reusing

2013-05-14 Thread Paul Sokolovsky
Hello, On Tue, 14 May 2013 23:31:03 +0530 kuldeep dhaka wrote: > hello guys, > > while coding (embedded devices) i got an idea. > [] > in the above code, after sending uart_send(before) , "before" is no > more useful to me. > but for while loop i have to get a new variable "i" for iteration.

Re: [Mspgcc-users] variable reusing

2013-05-14 Thread Hardy Griech
On 14.05.2013 20:01, kuldeep dhaka wrote: : > while coding (embedded devices) i got an idea. > > void uart_send_param(uint8_t before, uint8_t after, uint8_t default_value) > { > uint8_t i = 0; > > uart_send(ASCII_ESCAPE); > uart_send(before); > > while(before < vt100_param_getco

[Mspgcc-users] variable reusing

2013-05-14 Thread kuldeep dhaka
hello guys, while coding (embedded devices) i got an idea. void uart_send_param(uint8_t before, uint8_t after, uint8_t default_value) { uint8_t i = 0; uart_send(ASCII_ESCAPE); uart_send(before); while(before < vt100_param_getcount()) { if(vt100_param_get(i) != defaul