Thread overview
[Issue 14207] [REG2.065] [CTFE] ICE on unsupported reinterpret cast in compile time
[Issue 14207] Assertion failure: '(vd->storage_class & (STCout | STCref)) ? isCtfeReferenceValid(newval) : isCtfeValueValid(newval)' on line 6724 in file 'interpret.c'
Apr 01, 2015
Nicolas Sicard
[Issue 14207] [REG2.065] Assertion failure: '(vd->storage_class & (STCout | STCref)) ? isCtfeReferenceValid(newval) : isCtfeValueValid(newval)' on line 6724 in file 'interpret.c'
Apr 02, 2015
Kenji Hara
Apr 03, 2015
Kenji Hara
April 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14207

Nicolas Sicard <dransic@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |CTFE, ice
                 CC|                            |dransic@gmail.com
           Severity|normal                      |regression

--
April 02, 2015
https://issues.dlang.org/show_bug.cgi?id=14207

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Hardware|x86                         |All
            Summary|Assertion failure:          |[REG2.065] Assertion
                   |'(vd->storage_class &       |failure:
                   |(STCout | STCref)) ?        |'(vd->storage_class &
                   |isCtfeReferenceValid(newval |(STCout | STCref)) ?
                   |) :                         |isCtfeReferenceValid(newval
                   |isCtfeValueValid(newval)'   |) :
                   |on line 6724 in file        |isCtfeValueValid(newval)'
                   |'interpret.c'               |on line 6724 in file
                   |                            |'interpret.c'
                 OS|Windows                     |All

--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> ---
This is a regression from 2.065, introduced by the pull request: https://github.com/D-Programming-Language/dmd/pull/2612

And in 2.067, my CTFE interpreter improvement changed the appearance of the issue.

Reduced case:

ubyte[8] nativeToBigEndian()
{
    immutable ulong res = 1;
    return *cast(ubyte[8]*) &res;
}

auto digest()
{
    ubyte[8] bits = nativeToBigEndian();
    return bits;
}

// With 2.064, CTFE makes errors, but with 2.065 or later, it's silently
accepted.
enum h = digest();

void main()
{
    // With 2.065 or later, following code makes ICE in 'expression.c'
    //pragma(msg, h);

    // With 2.065 or later, following code makes ICE in 'expression.c' or
'e2ir.c'
    import std.stdio;
    auto a = h;
    writeln(a);
}

Compiler fix: https://github.com/D-Programming-Language/dmd/pull/4545

--
April 03, 2015
https://issues.dlang.org/show_bug.cgi?id=14207

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[REG2.065] Assertion        |[REG2.065] [CTFE] ICE on
                   |failure:                    |unsupported reinterpret
                   |'(vd->storage_class &       |cast in compile time
                   |(STCout | STCref)) ?        |
                   |isCtfeReferenceValid(newval |
                   |) :                         |
                   |isCtfeValueValid(newval)'   |
                   |on line 6724 in file        |
                   |'interpret.c'               |

--
April 04, 2015
https://issues.dlang.org/show_bug.cgi?id=14207

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
April 04, 2015
https://issues.dlang.org/show_bug.cgi?id=14207

--- Comment #2 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/82dca4ae9707fd91f4291088a3304e580cd9cd33 fix Issue 14207 - [CTFE] ICE on unsupported reinterpret cast in compile time

The problematic code in isSafePointerCast() was introduced in pull 2612 to fix
regression 10687.

https://github.com/D-Programming-Language/dmd/commit/b99758d01518e7bc51457d3f0d763a6c0923ffc1 Merge pull request #4545 from 9rnsr/fix14207

[REG2.065] Issue 14207 - [CTFE] ICE on unsupported reinterpret cast in compile time

--
June 17, 2015
https://issues.dlang.org/show_bug.cgi?id=14207

--- Comment #3 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/82dca4ae9707fd91f4291088a3304e580cd9cd33 fix Issue 14207 - [CTFE] ICE on unsupported reinterpret cast in compile time

https://github.com/D-Programming-Language/dmd/commit/b99758d01518e7bc51457d3f0d763a6c0923ffc1 Merge pull request #4545 from 9rnsr/fix14207

--