Bug 14613 – DMD: Internal error: backend/cod1.c 1567 on '-O' switch

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-05-21T10:14:00Z
Last change time
2017-01-07T03:02:30Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
saurabh.das

Attachments

IDFilenameSummaryContent-TypeSize
1523reduced_expr.dreduced_expr.dtext/plain974

Comments

Comment #0 by saurabh.das — 2015-05-21T10:14:30Z
Created attachment 1523 reduced_expr.d We have been working on a genetic programming project, and occasionally the compiler fails and gives an internal error. I've captured and reduced one of these down to a single expression. See reduced_expr.d (http://dpaste.dzfl.pl/raw/e7a66aa067ab) When I compile this file using: 'dmd -c -O reduced_expr.d' it fails with: DMD 2.066.1] Internal error: backend/cod1.c 1562 DMD 2.067.1] Internal error: backend/cod1.c 1567 The compile succeeds without the '-O' flag. Using dustmite, the expression in the file reduces to: double someFunction(double AvgPriceChangeNormalized, double TicksTenMinutesNormalized) { return (TicksTenMinutesNormalized?1:AvgPriceChangeNormalized)1:TicksTenMinutesNormalized/(TicksTenMinutesNormalized==0)==0; } This internal error has been reproduced on Linux (x86_64) and MacOS and on DMD versions 2.066.1 and 2.067.1.
Comment #1 by dfj1esp02 — 2015-05-21T12:30:38Z
Failing valid code is double someFunction(double a, double c) { return ((c==0?1:a)==0?1:c/(c==0?1:a))==0 ? 1 : c; }
Comment #2 by acehreli — 2015-05-21T15:49:04Z
Further reduced by Kagamin: double foo(double b) { return b / (b == 0) == 0; } (Remember, one needs -O to reproduce.) Ali
Comment #3 by bugzilla — 2016-10-30T05:21:29Z
Comment #4 by bugzilla — 2016-10-30T09:48:11Z
Comment #5 by github-bugzilla — 2016-11-03T05:33:14Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a4f584ffdc195cc99a738ba495c8261284813d2a fix Issue 14613 - DMD: Internal error: backend/cod1.c 1567 on '-O' switch https://github.com/dlang/dmd/commit/5f803b0d75a722937a13b6590176984c3d436403 Merge pull request #6218 from WalterBright/fix14613 fix Issue 14613 - DMD: Internal error: backend/cod1.c 1567 on '-O' sw…
Comment #6 by github-bugzilla — 2016-11-04T09:05:37Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a4f584ffdc195cc99a738ba495c8261284813d2a fix Issue 14613 - DMD: Internal error: backend/cod1.c 1567 on '-O' switch https://github.com/dlang/dmd/commit/5f803b0d75a722937a13b6590176984c3d436403 Merge pull request #6218 from WalterBright/fix14613
Comment #7 by github-bugzilla — 2016-12-27T14:40:50Z
Commits pushed to scope at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a4f584ffdc195cc99a738ba495c8261284813d2a fix Issue 14613 - DMD: Internal error: backend/cod1.c 1567 on '-O' switch https://github.com/dlang/dmd/commit/5f803b0d75a722937a13b6590176984c3d436403 Merge pull request #6218 from WalterBright/fix14613
Comment #8 by github-bugzilla — 2017-01-07T03:02:30Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a4f584ffdc195cc99a738ba495c8261284813d2a fix Issue 14613 - DMD: Internal error: backend/cod1.c 1567 on '-O' switch https://github.com/dlang/dmd/commit/5f803b0d75a722937a13b6590176984c3d436403 Merge pull request #6218 from WalterBright/fix14613