Bug 19343 – [regression] SROA breaks valid code with -O

Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-10-30T15:59:53Z
Last change time
2018-12-11T06:45:24Z
Keywords
ice-on-valid-code
Assigned to
No Owner
Creator
Stefan Koch

Comments

Comment #0 by uplink.coder — 2018-10-30T15:59:53Z
The bug appears when compiling the following code with -O void f(real x) {(x) {} (x); ulong m = *cast(ulong *) &x;} The compiler will assert fixresult_x87() in cg87.c because the size of the elem is bigger then DBLSIZE (usually 8). it seems that for some reason the enregistering of &x, is not undone. before extracting the first 64 bits of it. This is a rather serious bug which hints towards further problems inside the SORA code.
Comment #1 by uplink.coder — 2018-10-30T16:02:16Z
Comment #2 by bugzilla — 2018-12-11T06:45:24Z
I cannot reproduce this: 1. there is no cg87.c anymore, it is cg87.d 2. there is no fixresult_x87(), did you mean fixresult87() ? 3. which line asserts? 4. I cannot get this code to even wind up in fixresult87() 5. I tried it on Win32 and Win64 Please reopen if you can get it to fail with the current version of DMD.