r18252 - x*x -> sqr(x) optimization (Was: Re: [fpc-devel] ARM native compilation (Toshiba AC100))

Thomas Schatzl tom_at_work at gmx.at
Fri Sep 23 01:21:02 CEST 2011


 Hi,

 On Thu, 22 Sep 2011 11:28:48 +0100, Henry Vermaak wrote:
> On 22/09/11 11:23, Thomas Schatzl wrote:
>>
>> That is a known issue with 2.4.4 that it does not compile trunk with
>> optimization turned on. There seems to be a bug that has been 
>> existing
>> for a long time that has been triggered by code changes in 18230; 
>> the
>> ARM compiler is not as well maintained as others.
>>
>> I think 2.4.4 definitely builds when specifying -O- as extra build
>> options though. I am working on it, however I fear that -O- will 
>> need to
>> be set for some time.
>
> I think it breaks for me even if optimizations are turned off, but
> I'll double check.
>

 Unfortunately this seems to be true, need to investigate further. 
 However there is another bug regarding optimizations.

>> @henry: thanks for finding the revision when compilation broke.
>
> The revision I gave is just my last known good compile.  I can try
> and bisect if that'll be useful.

 I found that 18251 is okay, but the newer ones are not when compiling 
 with -O2. It seems that one optimization that transforms expressions of 
 type x*x into sqr(x) for floats in 18252 (and 18257 and 18263 that seem 
 to have been fixing issues with the original implementation) causes 
 troubles. With that in place, a compiler cycle hangs at ppc2 compiling 
 something (processing real2str.inc from the system unit fyi).

 Florian, Jonas, any ideas? Seems to be related to softfloat code 
 generation because apparently other platforms are fine.

 Thomas




More information about the fpc-devel mailing list