Thread overview
[Issue 4837] New: Assertion failure: '0' on line 608(614) in file 'constfold.c' during CTFE
Sep 07, 2010
Stanislav Blinov
[Issue 4837] ICE(constfold.c) CTFE with >>>=
Nov 15, 2010
simon
Nov 15, 2010
Don
Feb 06, 2011
Brad Roberts
Aug 24, 2011
Walter Bright
September 07, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4837

           Summary: Assertion failure: '0' on line 608(614) in file
                    'constfold.c' during CTFE
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: stanislav.blinov@gmail.com


--- Comment #0 from Stanislav Blinov <stanislav.blinov@gmail.com> 2010-09-07 13:05:21 PDT ---
Compilation fails with assertion in constfold.c:608 or constfold.c:614 for the following code:

bool foo(T)(T t)
{
    t >>>= 1;       // triggers assertion for ubytes and ushorts
    // t = t >>> 1; // this compiles with no errors
    return true;
}

void main()
{
    auto g1 = foo!ubyte(1); // Ok for runtime
    auto g2 = foo!ushort(1); // Ok for runtime

    // CTFE:
    enum e1 = foo!ubyte(1);  // Assertion failure: '0' on line 608 in file
'constfold.c'
    enum e2 = foo!ushort(1); // Assertion failure: '0' on line 614 in file
'constfold.c'
}

DMD 2.048

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 15, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4837


simon <s.d.hammett@googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|nobody@puremagic.com        |s.d.hammett@googlemail.com


--- Comment #1 from simon <s.d.hammett@googlemail.com> 2010-11-15 12:24:38 PST ---
Created an attachment (id=814)
PATCH against rev 755: remove superfluous asserts

fixed, no idea why asserts where placed in there.
unsigned shifting of 8 ^ 16 bit values seems perfectly reasonable.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 15, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4837



--- Comment #2 from Don <clugdbug@yahoo.com.au> 2010-11-15 12:39:53 PST ---
(In reply to comment #1)
> Created an attachment (id=814) [details]
> PATCH against rev 755: remove superfluous asserts
> 
> fixed, no idea why asserts where placed in there.
> unsigned shifting of 8 ^ 16 bit values seems perfectly reasonable.

The problem is that the code there gives different results to what happens in
all other situations. See bug 2809.
As far as I can tell, >>> is a broken concept. Andrei and I tried to get it
removed from the language before publication of TDPL, but we failed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 06, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4837


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86_64                      |x86


--- Comment #3 from Brad Roberts <braddr@puremagic.com> 2011-02-06 15:39:40 PST ---
Mass migration of bugs marked as x86-64 to just x86.  The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4837


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> 2011-08-24 12:58:43 PDT ---
https://github.com/D-Programming-Language/dmd/commit/4fa620ba567bdf1c9be09d46d089a9fc364cc9d2

https://github.com/D-Programming-Language/dmd/commit/8f24469bd1cc3b6b33fd539ccf9d8dab3135156f

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------