Thread overview
[Issue 15450] ICE during CTFE of legit function
Dec 15, 2015
ag0aep6g@gmail.com
Dec 16, 2015
Kenji Hara
Dec 16, 2015
Kenji Hara
December 15, 2015
https://issues.dlang.org/show_bug.cgi?id=15450

--- Comment #1 from Andrei Alexandrescu <andrei@erdani.com> ---
Shorter repro. It's the labeled continue that's the problem:

struct BigO
{
    struct Atom
    {
        int id;
        double exp;
        double logExp;
    }

    private Atom[][] terms;

    int opCmp(const BigO rhs) const
    {
        int result = 0;
    bigone:
        foreach (ref l; terms)
        {
            foreach (ref r; rhs.terms)
            {
                continue bigone;
            }
        }
        return result;
    }
}

static immutable
    linear = BigO([ [ BigO.Atom(0, 1, 0) ] ]);

static assert(linear >= linear);

--
December 15, 2015
https://issues.dlang.org/show_bug.cgi?id=15450

ag0aep6g@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice
                 CC|                            |ag0aep6g@gmail.com
           Severity|normal                      |regression

--- Comment #2 from ag0aep6g@gmail.com ---
2.069.2 gives "Error: cannot interpret <continue> at compile time", which is at least not an ICE.

git head (6cd7173) gives "core.exception.AssertError@dinterpret.d(1008):
Assertion failure", making this a diagnostic regression.

Further reduced test case:
----
static assert({
    bigone: foreach (l; [0]) continue bigone;
    return true;
}());
----

--
December 15, 2015
https://issues.dlang.org/show_bug.cgi?id=15450

--- Comment #3 from Andrei Alexandrescu <andrei@erdani.com> ---
Nice, thanks. Hmmm, I was running v2.068.2. So should we qualify this as silently fixed?

--
December 15, 2015
https://issues.dlang.org/show_bug.cgi?id=15450

--- Comment #4 from Andrei Alexandrescu <andrei@erdani.com> ---
Oh wait, the HEAD doesn't work either (albeit with a different diagnostic). So this bug stands. Thanks!

--
December 16, 2015
https://issues.dlang.org/show_bug.cgi?id=15450

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|regression                  |major

--- Comment #5 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to ag0aep6g from comment #2)
> 2.069.2 gives "Error: cannot interpret <continue> at compile time", which is at least not an ICE.
> 
> git head (6cd7173) gives "core.exception.AssertError@dinterpret.d(1008):
> Assertion failure", making this a diagnostic regression.

>From 2.069.0, released dmd binary is compiled with -release, so all of internal
asserts won't hit.

Note that, ICE also happens with 2.068, like:

Assertion failure: '!e || (e->op != TOKcontinue && e->op != TOKbreak)' on line 1034 in file 'interpret.c'

abnormal program termination


Therefore, this is not a regression from 2.069.

--
December 16, 2015
https://issues.dlang.org/show_bug.cgi?id=15450

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #6 from Kenji Hara <k.hara.pg@gmail.com> ---
https://github.com/D-Programming-Language/dmd/pull/5312

--
January 08, 2016
https://issues.dlang.org/show_bug.cgi?id=15450

--- Comment #7 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/7d477b5be6e174a529fbeffceb61593624201897 Reboot #5312: fix Issue 15450 - ICE during CTFE of legit function

https://github.com/D-Programming-Language/dmd/commit/a540e39b75fc02b91fe448f52e242db5765723e3 Merge pull request #5336 from WalterBright/reboot5313

Reboot #5312: fix Issue 15450 - ICE during CTFE of legit function

--
March 19, 2016
https://issues.dlang.org/show_bug.cgi?id=15450

--- Comment #8 from github-bugzilla@puremagic.com ---
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/7d477b5be6e174a529fbeffceb61593624201897 Reboot #5312: fix Issue 15450 - ICE during CTFE of legit function

https://github.com/D-Programming-Language/dmd/commit/a540e39b75fc02b91fe448f52e242db5765723e3 Merge pull request #5336 from WalterBright/reboot5313

--