[Issue 13007] Wrong x86 code: long negate

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 12 01:09:40 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13007

yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies at gmail.com

--- Comment #1 from yebblies <yebblies at gmail.com> ---
I can reproduce in a single file with this:

================

import std.datetime;
import core.time;

class Foo
{
    SysTime getFooTime(SysTime time)
    {
        Bar bar = new Bar;

        auto time2 = time + bar.barDuration() - dur!"seconds"(120);

        if (fooBool)
            return SysTime.max;

        return time2;
    }

    bool fooBool()
    {
        return false;
    }
}

void main()
{
    auto now = Clock.currTime;
    auto foo = new Foo();
    assert(now == foo.getFooTime(now) + dur!"seconds"(120));
}

class Bar
{
    Duration barDuration()
    {
        return dur!"seconds"(0);
    }
    SysTime bazTime = SysTime.max;
}

================

But with druntime and phobos imports I don't have the energy to try and reduce
this further at the moment.

--


More information about the Digitalmars-d-bugs mailing list