See http://redmine.blackboxframework.org/issues/42, which also contains a test program.
A proposal for fixing this bug exists in CPC 1.7 rc5.
The fix needs detailed knowledge about the code generation in the compiler and is not easy to understand.
There is no topic branch for this fix yet because it would create a merge conflict with issue-#41.
Luowy and Ivan, can you please comment on your fix in module DevCPC486
so that it is possible to understand what is going on?
Code: Select all
(* largeint support *)
| div:
IF y.mode # Reg THEN LoadR(y); rev := ~rev END; (* <<< patch by luowy, 19-Dec-2011 + Ivan Denisov *)
IF rev THEN DevCPL486.GenFDOp(FDIVR, y) ELSE DevCPL486.GenFDOp(FDIV, y) END;
Floor(y, FALSE)