[Issue 3751] Optimalization error in some floating point code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 29 05:48:52 PST 2010


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



--- Comment #6 from Witold Baryluk <baryluk at smp.if.uj.edu.pl> 2010-01-29 05:48:52 PST ---
(In reply to comment #4)
> I'm not certain that there's a bug here (difficult to tell without reducing the
> test case further). It could be that in the optimised case you have a temporary
> value stored in a register, increasing the precision. It's legal for the
> compiler to do that. Adding a function call stops DMD from keeping the value in
> a register.
> Anyway you need to cut the test case down significantly.
> BTW it behaves the same way on DMD0.175, so this is definitely not a
> regression.

Hmm, You are probably right.

Changing coditions to:
    if (left <= half) {
        break;
    }

    if (half >= right) {
        break;
    }

solves problem.

Interesingly compiling in gdc even with -O3 -finline -frelease
-funsafe-math-optimizations -frounding-math -ffast-math doesn't bring this
error.

What is also problematic is that even adding forcibly something like
cast(double) doesn't solve problem (they are noop's, becuase they are already
of correct type).

-- 
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