D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3315 - ICE(mtype.c) floating point converted to an integer type and passed to a function, when certain incompatible overloads exist
Summary: ICE(mtype.c) floating point converted to an integer type and passed to a func...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 regression
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code, ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2009-09-12 15:17 UTC by Stewart Gordon
Modified: 2015-06-09 01:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stewart Gordon 2009-09-12 15:17:29 UTC
void qwert(int yuiop, int asdfg) {}
void qwert(long yuiop) {}

void hjkl(real zxcvb) {
	qwert(cast(long) zxcvb);
}
----------
Assertion failure: '0' on line 1566 in file 'mtype.c'

abnormal program termination
----------

Same ICE if:
(a) line 1 is instead
    void qwert(short yuiop, short asdfg) {}
(b) in addition to (a), asdfg is cast to an int instead
(c) line 2 is removed (hence ice-on-invalid-code)

Compiles successfully if:
- line 1 is removed
- cast is changed to int, but function sigs kept the same
- line 1 parameters changed to long
- hjkl is instead
    void hjkl(real zxcvb) {
        long nm = cast(long) zxcvb;
        qwert(nm);
    }
- I use DMD 1.047 instead
Comment 1 Don 2009-09-13 03:33:55 UTC
This is probably the same as the nasty regression bug 3173. I'd submitted the patch to Walter just before 2.032 was released, but unfortunately it missed the deadline. We considered delaying the release of 2.032 by another few days because of it.
Comment 2 Don 2009-09-14 23:56:19 UTC
This is a regression. My patch for bug 3173 fixes it. It's not the same as bug 3173, since this is an ice-on-valid-code.
Comment 3 Don 2009-10-06 02:54:32 UTC
Fixed DMD2.033.