On 23 Sep 2011, at 01:21, Thomas Schatzl wrote:

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.

The optimization changes x*x into sqr(x). For ARM/softfloat, the compiler calls the fpc_sqr_real() helper from the RTL.

The code of this helper is:

function fpc_sqr_real(d : ValReal) : ValReal;compilerproc;{$ifdef MATHINLINE}inline;{$endif}
    begin
      result := d*d;
    end;

So yes, this clearly puts the compiler into an endless loop. I'm not sure what would be a clean fix for this (other than completely disabling the transformation; does it improve the generated code that much beyond what CSE can achieve?)


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to