Bug 13819 – ICE: backend\cg87.c with -O: "a % 2 != 0" for a double

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-04T23:26:10Z
Last change time
2019-05-30T23:30:26Z
Keywords
ice, ice-on-valid-code, pull
Assigned to
No Owner
Creator
ponce

Comments

Comment #0 by aliloko — 2014-12-04T23:26:10Z
With DMD 2.066.1, the following program crash DMD with -O. ------------- reduced.d --------------- void heh() { enum fun = "x % 2 != 0"; (int a) { double x = a; mixin("return " ~ fun ~ ";"); }( 4 ); } --------------------------------------- $ dmd -O reduced.d Internal error: backend\cg87.c 1495
Comment #1 by aliloko — 2015-10-26T13:10:31Z
Still happens with DMD64 D Compiler v2.069.0-b2
Comment #2 by gassa — 2017-06-02T23:53:27Z
The error is still there with DMD 2.074.1. -m32: Internal error: ddmd\backend\cg87.c 1518 -m64: Internal error: ddmd\backend\cgxmm.c 931
Comment #3 by gassa — 2017-06-02T23:59:15Z
Actually, this compiles fine: -----good1.d----- int f (double a) { a = a % 2; return a != 0; } ----- And this triggers an error: -----bad1.d----- int f (double a) { return a % 2 != 0; } -----
Comment #4 by ag0aep6g — 2017-06-16T17:32:25Z
*** Issue 17383 has been marked as a duplicate of this issue. ***
Comment #5 by dlang-bot — 2019-05-30T22:15:43Z
@Basile-z created dlang/dmd pull request #9924 "fix issue 13819 - ICE: backend\cg87.c with -O: "a % 2 != 0" for a double" fixing this issue: - fix issue 13819 - ICE: backend\cg87.c with -O: "a % 2 != 0" for a double https://github.com/dlang/dmd/pull/9924
Comment #6 by dlang-bot — 2019-05-30T23:30:26Z
dlang/dmd pull request #9924 "fix issue 13819 - ICE: backend\cg87.c with -O: "a % 2 != 0" for a double" was merged into stable: - 0dde3e873354f5fdce20703d0008e7b387832792 by Basile Burg: fix issue 13819 - ICE: backend\cg87.c with -O: "a % 2 != 0" for a double https://github.com/dlang/dmd/pull/9924