Bug 11322 – ICE with -inline cgcs.c 221

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-22T02:53:00Z
Last change time
2013-11-19T10:55:46Z
Keywords
ice
Assigned to
nobody
Creator
code
Depends on
11317

Attachments

IDFilenameSummaryContent-TypeSize
1277repro.ziprepro caseapplication/zip1272

Comments

Comment #0 by code — 2013-10-22T02:53:23Z
Created attachment 1277 repro case The attached repro case causes a ICE. Tested with the latest git head of the dmd 2.064 branch. Omitting -inline will avoid the ICE.
Comment #1 by yebblies — 2013-11-14T05:11:16Z
bool b; uint i; ref uint fun() { if(b) return i; else return i; } void analyze() { fun()++; }
Comment #2 by yebblies — 2013-11-14T05:39:48Z
For analyze, the inliner generates (b ? i : i)++; and because the results of the inliner are never run through semantic, it never gets converted to the lvalue version (*(b ? &i : &i))++; This is an inliner bug... The way the inliner interacts with ref is not great.
Comment #3 by bugzilla — 2013-11-17T22:14:33Z
Comment #4 by github-bugzilla — 2013-11-19T10:54:13Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/96dc2c14f4b5a783195f6792beb6f19988552455 fix Issue 11322 - ICE with -inline cgcs.c 221 https://github.com/D-Programming-Language/dmd/commit/edd9eb0a12a2ba0c9483ffb12200eb35645215ea Merge pull request #2823 from 9rnsr/fix11322 Issue 11322 - ICE with -inline cgcs.c 221
Comment #5 by bugzilla — 2013-11-19T10:55:02Z
Comment #6 by bugzilla — 2013-11-19T10:55:46Z
*** Issue 11323 has been marked as a duplicate of this issue. ***