Pelles C forum

Pelles C => General discussions => Topic started by: CLR on December 15, 2004, 11:16:09 PM

Title: Floating-point expression too complex
Post by: CLR on December 15, 2004, 11:16:09 PM
Hello

I'm getting the error 'Floating-point expression too complex' when compiling  spidermonkey (http://www.mozilla.org/js/spidermonkey/)

The error is at line 320:
http://lxr.mozilla.org/seamonkey/source/js/src/fdlibm/e_pow.c#320

This is the command line I run
pocc.exe /D __STDC__ /D NDEBUG /D WIN32 /D _X86_=1 /D _WINDOWS /D _IEEE_LIBM /D XP_WIN /c .\fdlibm\e_pow.c

Should I add/change something?

Spidermonkey - Full download:
ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.5-rc6a.tar.gz
Title: Floating-point expression too complex
Post by: Pelle on December 16, 2004, 01:10:25 AM
It looks like the reported line is a bit off. The real problem seems to be with line 295, and the following expression:


r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6)))));


The compiler gets annoyed because too many values are pushed onto the floating-point stack at one time. The original LCC compiler isn't very good at this, and I havn't done much about it (since I never use floating-point math).

It could be, for example, changed to the following - which will help the compiler.


r = s2*s2*(s2*(s2*(s2*(s2*(s2*L6+L5)+L4)+L3)+L2)+L1);


I will try and do something to the next release. It's the best I can do.

Pelle
Title: Floating-point expression too complex
Post by: CLR on December 16, 2004, 01:38:29 AM
OK. Thank you.
Title: Floating-point expression too complex
Post by: john on December 27, 2004, 11:26:45 PM
lcc-win32 doesn't have problems with that