Bug 18197 – [REG2.073] Internal error: backend\cgcod.c 1659

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2018-01-05T17:53:51Z
Last change time
2018-03-28T01:11:22Z
Keywords
ice
Assigned to
No Owner
Creator
Richard Manthorpe

Comments

Comment #0 by rmanth — 2018-01-05T17:53:51Z
testcase.d ----- struct A { double a; } pair makeA(double value) { return pair(value); } double test(double x) { ulong* p = *cast(ulong *)&x; return makeA(x).a; } ---- dmd -m32 -c -inline -O testcase.d dmd -m32mscoff -c -inline -O testcase.d both fail with "Internal error: Internal error: backend\cgcod.c 1659" This first appears in v2.073.0-b1 and is still present in nightly builds with "Internal error: dmd\backend\cgcod.c 1688"
Comment #1 by r.sagitario — 2018-01-14T23:03:18Z
Corrected test case: struct A { double a; } A makeA(double value) { return A(value); } double test(double x) { ulong p = *cast(ulong *)&x; return makeA(x).a; }
Comment #2 by bitter.taste — 2018-03-25T21:41:24Z
Comment #3 by bugzilla — 2018-03-27T05:57:22Z
(In reply to Rainer Schuetze from comment #1) > Corrected test case: I cannot reproduce a failure. What dmd flags are you using?
Comment #4 by bugzilla — 2018-03-27T05:59:42Z
(In reply to Walter Bright from comment #3) > (In reply to Rainer Schuetze from comment #1) > > Corrected test case: > > I cannot reproduce a failure. What dmd flags are you using? Ah, I see. It is classified above as an x86_64 problem, but it is an x86 problem. The flags to repro it are: -m32 -O -inline
Comment #5 by github-bugzilla — 2018-03-28T01:11:21Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/689fa72cb110250bc8b0dc152e48e20ba1f67cf9 Fix issue 18197 - Correct optimization for OPpair in x87 mode Attempting to push a non-fp value into mST0 results in a ICE. https://github.com/dlang/dmd/commit/69ece8ca5b0bcaf290cfcb8a29c44048e9678284 Merge pull request #8082 from LemonBoy/b18197 Fix Issue 18197 - Correct optimization for OPpair in x87 mode merged-on-behalf-of: Walter Bright <[email protected]>