[Issue 6505] Wrong code for expression involving 8 floats, only with -O

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 23 01:52:53 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6505



--- Comment #2 from Don <clugdbug at yahoo.com.au> 2011-08-23 01:52:36 PDT ---
Thanks bearophile, that reduction is very helpful.

The code loads 8 values on the x87 stack. The eighth one would cause an
overflow, so in cg87.c, push87(), it inserts:

fdecstp;
fstp [EBP - 24];

The next line is:
fld [EBP - 18];

The code passes to the scheduler, where there's a bug: it converts the code to:

fdecstp;
fld [EBP - 18];
fxch ST(1);
fstp [EBP - 24];

This is an x87 stack overflow, since the load happens before space has been
made in the save. The x87 returns a NaN.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list