Bug 14341 – [REG 2.067] Crash with -O -release -inline after sort and map!(to!string)

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-03-25T20:44:00Z
Last change time
2015-04-03T17:11:54Z
Keywords
pull
Assigned to
nobody
Creator
gassa

Attachments

IDFilenameSummaryContent-TypeSize
1498e2min.dexample codetext/plain276

Comments

Comment #0 by gassa — 2015-03-25T20:44:24Z
Created attachment 1498 example code This example, compiled as "dmd -O -release -inline -m64" on Win64, reproducibly crashes with dmd 2.067.0-b2 and later up to dmd 2.067.0 release, and reproducibly does not crash with dmd 2.066.1 and earlier. ----- import std.algorithm, std.conv, std.range, std.stdio; void main () { auto arr = [7, 5, 7, 3, 3, 5, 3, 3, 0, 3, 1, 1, 5, 1, 1, 1, 2, 2, 8, 5, 8, 8]; arr.sort !((x, y) => arr.count (x) > arr.count (y) || (arr.count (x) == arr.count (y) && x < y), SwapStrategy.stable) .map !(to !(string)) .join (" ") .writeln; // prints 1 1 1 1 1 3 3 3 3 3 5 5 5 5 8 8 8 2 2 7 7 0 } ----- The D.learn discussion resulting in this example: http://forum.dlang.org/thread/[email protected] A somewhat minimized example: ----- import std.algorithm, std.conv, std.stdio; void main () { auto arr = [1]; version (S1) sort (arr); version (S2) sort !(q{a < b}, SwapStrategy.stable) (arr); auto s = map !(to !(string)) (arr); if (s.front != "1") { writeln ("?"); } } ----- Crashes with either dmd -O -release -inline -m64 -version=S1 or dmd -O -release -inline -m64 -version=S2
Comment #1 by dlang-bugzilla — 2015-03-26T11:10:57Z
Comment #2 by k.hara.pg — 2015-03-26T14:37:31Z
(In reply to Vladimir Panteleev from comment #1) > Introduced in https://github.com/D-Programming-Language/dmd/pull/4415 This is a dup of issue 14220, but its fix is not yet cherry-picked in 2.067 branch.
Comment #3 by k.hara.pg — 2015-03-26T14:42:14Z
Comment #4 by k.hara.pg — 2015-04-03T17:11:54Z
(In reply to Kenji Hara from comment #2) > (In reply to Vladimir Panteleev from comment #1) > > Introduced in https://github.com/D-Programming-Language/dmd/pull/4415 > > This is a dup of issue 14220, but its fix is not yet cherry-picked in 2.067 > branch. The 14220 fix was cherry-picked in stable branch.