D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14060 - Internal error: backend/cg87.c 3394 only in MacOSX
Summary: Internal error: backend/cg87.c 3394 only in MacOSX
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Mac OS X
: P1 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2015-01-27 13:26 UTC by Kenji Hara
Modified: 2020-08-06 16:07 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2015-01-27 13:26:06 UTC
I found this issue from the auto-tester result of my PR:
https://github.com/D-Programming-Language/dmd/pull/4331

Following code is a part of test/runnable/interpret.d. With -m32 -O -inline -release,  the code would cause following backend ICE.

Internal error: backend/cg87.c 3394

If you add writefln call in the compare function, the ICE would disappear.

version(addWriteln) import std.stdio;
else extern(C) int printf(const char*, ...);

void test113()
{
    import core.math;

    static void compare(real a, real b)
    {
        version(addWriteln) writefln("compare(%30.30f, %30.30f);", a, b);
        assert(fabs(a - b) < 128 * real.epsilon);
    }

    static if (__traits(compiles, (){ enum real ctval1 = yl2x(3.14, 1); }))
    {
        enum real ctval1 = yl2x(3.14, 1);
        enum real ctval2 = yl2x(2e1500L, 3);
        enum real ctval3 = yl2x(1, 5);

        real rtval1 = yl2x(3.14, 1);
        real rtval2 = yl2x(2e1500L, 3);
        real rtval3 = yl2x(1, 5);

        compare(ctval1, rtval1);
        compare(ctval2, rtval2);
        compare(ctval3, rtval3);
    }

    static if (__traits(compiles, (){ enum real ctval4 = yl2xp1(3.14, 1); }))
    {
        enum real ctval4 = yl2xp1(3.14, 1);
        enum real ctval5 = yl2xp1(2e1500L, 3);
        enum real ctval6 = yl2xp1(1, 5);

        real rtval4 = yl2xp1(3.14, 1);
        real rtval5 = yl2xp1(2e1500L, 3);
        real rtval6 = yl2xp1(1, 5);

        compare(ctval4, rtval4);
        compare(ctval5, rtval5);
        compare(ctval6, rtval6);
    }
}

int main()
{
    test113();

    printf("Success\n");
    return 0;
}
Comment 1 Mathias LANG 2020-08-06 16:07:11 UTC
MacOSX 32 bits have been retired, so closing as WONTFIX.