www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4751] New: fail_compilation/fail37.d hits an assert in constfold

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4751

           Summary: fail_compilation/fail37.d hits an assert in constfold
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: braddr puremagic.com


--- Comment #0 from Brad Roberts <braddr puremagic.com> 2010-08-29 00:08:07 PDT
---
to repro, from $(DMD_SVN_ROOT)/src/test:

make test_results/fail_compilation/fail37.d.out

or:

../src/dmd -Ifail_compilation -odtest_results/fail_compilation
-oftest_results/fail_compilation/fail37 -c fail_compilation/fail37.d

The code:

ulong[cast(uint)((cast(float)int.sizeof/ulong.sizeof)-int.max>>2)+int.max>>2]  
hexarray;

The assert:
fail_compilation/fail37.d(1): Error: 'cast(float)4u / cast(float)8u -
cast(float)2147483647' is not of integral type, it is a float
dmd: constfold.c:590: Expression* Shr(Type*, Expression*, Expression*):
Assertion `0' failed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 29 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4751


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
            Summary|fail_compilation/fail37.d   |Regression(1.062, 2.047)
                   |hits an assert in constfold |ICE(constfold.c) >> after
                   |                            |error


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-08-31 00:41:06 PDT ---
Reduced test case:

ulong [undefined>>1]   hexarray;
ulong [undefined>>>1]   hexarray2;

It doesn't fail with [undefined<<1]

This is caused by the error propagation introduced in 2.047. 

PATCH constfold.c, Shr(), line 589

        case Tuns64:
                value = (d_uns64)(value) >> count;
                break;

+        case Terror:
+            return e1;

        default:
                assert(0);
    }

And exactly the same for UShr() line 630.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 31 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4751


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 31 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4751


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw ubuntu.com


--- Comment #2 from Don <clugdbug yahoo.com.au> 2010-09-03 11:38:15 PDT ---
*** Issue 4792 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 03 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4751


Walter Bright <bugzilla digitalmars.com> changed:

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


--- Comment #3 from Walter Bright <bugzilla digitalmars.com> 2010-09-11
14:05:38 PDT ---
http://www.dsource.org/projects/dmd/changeset/670

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