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

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

Re: [avr-gcc-list] Space optimisation for PSTR()


From: E. Weddington
Subject: Re: [avr-gcc-list] Space optimisation for PSTR()
Date: Fri, 27 Aug 2004 11:23:45 -0600
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Bernard Fouché wrote:

Yeah I was wrong in the parenthesis places but you got the point.

I asked this question because I thought that compilers were used to optimise
strings that way.

Thanks for your answer


Yes compilers *can* be used in this way, and certain compilers (most) do this.

The main problem here is that the AVR is a Harvard Architecutre device, with separate Program Address Space and Data Address Space. The current C Standard does not have anything to account for different address spaces, and consequently GCC does not know anything about it either. From what I understand, is that there are drafts out there that will correct the C Standard to help address this issue. We know of one AVR developer (Svein Seldal) who is trying to patch GCC to get it to know about different address spaces. This is a very huge task. Probably when this happens then additional opimisation can be added to combine references to identical strings that reside in the program space. Until this happens, you'll have to manage your own strings. Sorry. :-(

Eric



reply via email to

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