Re: [avr-gcc-list] cLib... Reentrant?

2009-03-03 Thread Dmitry K.
> > Is the cLib, in general, written as reentrant code? > > Specifically floating point (yes), printf and friends?, small > > string functions (strcat_P(), etc)? intrinsic like div() and ldiv()? > > See: > In addition: the float point functions are not chan

Re: [avr-gcc-list] Re: sprintf

2009-03-03 Thread Georg-Johann Lay
David Brown schrieb: However, the compiler has a much better chance of doing bounds checking, alias checking, and other optimisations on the array expression. It is even free to reorganise the array, or keep it all in registers (I don't think any compilers do that, but maybe one day...), wher

RE: [avr-gcc-list] Re: sprintf

2009-03-03 Thread Stu Bell
> > (The compiler would even be allowed to optimize the sprintf() case, > > but by now, it doesn't do that.) > > Is it possible for a compiler to be *too* good, if it > generates optimal code despite terrible source? Not according to many of the whiner... Errr *users* that post regularly o

Re: [avr-gcc-list] Re: sprintf

2009-03-03 Thread Pertti Kellomäki
David Brown wrote: It is even free to reorganise the array, or keep it all in registers (I don't think any compilers do that, but maybe one day...), In a piece of DSP code, our LLVM-based compiler was able to convert a small temporary array into a set of scalar variables, which subsequently en

[avr-gcc-list] Re: sprintf

2009-03-03 Thread David Brown
Joerg Wunsch wrote: David Brown wrote: and memset((A_String + 16), 0, 1); has the same effect as : A_String[16] = 0x00; delay_about_30_processor_cycles(); waste_about_80_bytes_of_code_space(); Only if you're using -ffreestanding (e.g., in order to get GCC to

[avr-gcc-list] Re: sprintf

2009-03-03 Thread David Brown
Joerg Wunsch wrote: David Brown wrote: Secondly, using pointer arithmetic when array access is the logically correct method is very bad practice. That's often a matter of taste. Once you grasped the C pointer semantics, I usually find foo + i much easier to parse than &fo

RE: [avr-gcc-list] cLib... Reentrant?

2009-03-03 Thread Weddington, Eric
> -Original Message- > From: > avr-gcc-list-bounces+eweddington=cso.atmel@nongnu.org > [mailto:avr-gcc-list-bounces+eweddington=cso.atmel@nongnu. > org] On Behalf Of Larry Barello > Sent: Tuesday, March 03, 2009 11:05 AM > To: AVR GCC List > Subject: [avr-gcc-list] cLib... Reen

[avr-gcc-list] cLib... Reentrant?

2009-03-03 Thread Larry Barello
Is the cLib, in general, written as reentrant code? Specifically floating point (yes), printf and friends?, small string functions (strcat_P(), etc)? intrinsic like div() and ldiv()? I realize there are issues with the stdio stuff since the file descriptors are static and it is up to the i/o ro