D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15898 - [REG2.069] Internal error: backend\cgcod.c 1651
Summary: [REG2.069] Internal error: backend\cgcod.c 1651
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 regression
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2016-04-08 14:30 UTC by Kenji Hara
Modified: 2016-04-17 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 2016-04-08 14:30:34 UTC
From 2.069, following code is broken.

Code:

int addAssignSimple(int[] , const(int)[] )
{
    uint c;
    return c;
}

void mulKaratsuba(int[] result, const(int)[] x, const(int)[] y, int[] )
{
    const(int)[] y1 = y;
    int[] newscratchbuff;
    int[] resultHigh = result;

    bool ysmaller2 = x.length >= y1.length;
    newscratchbuff[0..y1.length] = resultHigh;
    mulKaratsuba(
        resultHigh[1..$],
        ysmaller2 ? x[1..$] : y1,
        ysmaller2 ? y1 : x,
        newscratchbuff[y1.length..$]
    );

    addAssignSimple(resultHigh[1..$], newscratchbuff[0..y1.length]);
}

Command and output:

> dmd -O -c test.d
DMD v2.069 DEBUG
findreg(0, line=1919, file='backend\cgcod.c', function = '_D4test12mulKaratsubaFAiAxiAxiAiZv')
Internal error: backend\cgcod.c 1651

Regression introduced in:
https://github.com/D-Programming-Language/dmd/pull/5100
Comment 1 Kenji Hara 2016-04-08 14:33:00 UTC
I found this problem during my PR updating for issue 6620.

https://github.com/D-Programming-Language/dmd/pull/4035
Comment 3 github-bugzilla 2016-04-14 08:46:08 UTC
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4f32b7f31453107ad2c12f3801c9e916a718efd0
fix Issue 15898 - [REG2.069] Internal error: backend\cgcod.c 1651

https://github.com/D-Programming-Language/dmd/commit/0810e354381c2d1551059e24f440415332bf50cf
Merge pull request #5660 from 9rnsr/fix15898

fix Issue 15898 - [REG2.069] Internal error: backend\cgcod.c 1651
Comment 4 github-bugzilla 2016-04-17 16:07:23 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/4f32b7f31453107ad2c12f3801c9e916a718efd0
fix Issue 15898 - [REG2.069] Internal error: backend\cgcod.c 1651

https://github.com/dlang/dmd/commit/0810e354381c2d1551059e24f440415332bf50cf
Merge pull request #5660 from 9rnsr/fix15898