www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11484] New: [e2ir] Error in e2ir at static array to numeric cast

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

           Summary: [e2ir] Error in e2ir at static array to numeric cast
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-11-09
21:36:16 MSK ---
---
void main()
{
    float[1] f1;
    auto i = cast(int) f1;
}
---
main.d(4): Error: e2ir: cannot cast f1 of type float[1] to type int
---

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 09 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11484


Denis Shelomovskij <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[e2ir] Error in e2ir at     |[e2ir] Error in e2ir at
                   |static array to numeric     |cast to/from static array
                   |cast                        |


--- Comment #1 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-11-09
22:03:09 MSK ---
Same ICE in reverse direction. Let's cast `Object` now:
---
void main()
{
    Object o; // or an array, or a pointer,...
    auto i1 = cast(int[1]) o;
}
---
main.d(4): Error: e2ir: cannot cast i of type int to type float[1]
---

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11484


Maxim Fomin <maxim maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice                         |
                 CC|                            |maxim maxim-fomin.ru


--- Comment #2 from Maxim Fomin <maxim maxim-fomin.ru> 2013-11-09 12:01:38 PST
---
And what will exactly the code

void main()
{
    Object o; // or an array, or a pointer,...
    auto i1 = cast(int[1]) o;
}

produce? A class instance converted to a pointer converted to an integer
converted to a static integer array of 1 element? Why stop here? Why not

struct S
{
  int[1] data;
}

S s = cast(S)new Object() 

and making the exact chain above plus creating struct from static array?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11484


Denis Shelomovskij <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice


--- Comment #3 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-11-09
23:53:06 MSK ---
(In reply to comment #2)
 And what will exactly the code produce?
An ICE. A normal compiler error is expected. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11484



--- Comment #4 from Maxim Fomin <maxim maxim-fomin.ru> 2013-11-09 13:28:23 PST
---
(In reply to comment #3)
 (In reply to comment #2)
 And what will exactly the code produce?
An ICE. A normal compiler error is expected.
It is an error. If you look into usual practice of tagging, you will see that these issues are not ice, because there is no compiler crashes, segfaults, overflows, etc. Better keyword is probably diagnostic. The only detail which can be argued to be 'compiler internal' is mentioning 'e2ir' which does not affect anything. Do you consider struct S { this(this) {} } struct SS { const(S) s; } Error: mutable method f167.S.__postblit is not callable using a const object an ice because '__postblit' is 'internal error message'? What is more important, is that all these issues filed against 'e2ir' are useless. There is no need to spend time on inventing cases which produces 'e2ir' and pusing dozens of them to bugzilla because all these 'ICEs' are fixable using grep within several minutes. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11484



--- Comment #5 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-11-10
19:14:12 MSK ---
(In reply to comment #4)
 (In reply to comment #3)
 (In reply to comment #2)
 And what will exactly the code produce?
An ICE. A normal compiler error is expected.
It is an error.
See Issue 3537 Comment 3. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 10 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11484


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies gmail.com


--- Comment #6 from yebblies <yebblies gmail.com> 2013-11-15 18:37:57 EST ---
(In reply to comment #4)
 
 What is more important, is that all these issues filed against 'e2ir' are
 useless. There is no need to spend time on inventing cases which produces
 'e2ir' and pusing dozens of them to bugzilla because all these 'ICEs' are
 fixable using grep within several minutes.
Completely wrong. All of the 'e2ir' errors are produced in the glue layer, not the frontend. This means: semantic fails to reject this code, interpreter sees broken code, compiling with -o- fails to detect an error. These are internal compiler errors, the fact that it doesn't crash it irrelevant. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 14 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11484


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, pull


--- Comment #7 from yebblies <yebblies gmail.com> 2013-11-17 15:31:04 EST ---
https://github.com/D-Programming-Language/dmd/pull/2788

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 16 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11484


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

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


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