Bug 21888 – sorting medium sized tuples at compile time not possible

Status
NEW
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-03T14:21:31Z
Last change time
2024-12-01T16:38:49Z
Assigned to
No Owner
Creator
Berni44
See also
https://issues.dlang.org/show_bug.cgi?id=21429
Moved to GitHub: phobos#9822 →

Comments

Comment #0 by bugzilla — 2021-05-03T14:21:31Z
While checking https://issues.dlang.org/show_bug.cgi?id=21429 I noticed a regression: Meanwhile medium sized sorting, like import std.algorithm; import std.typecons; auto foo() { enum n = 100; auto x = new Tuple!int[n]; x.sort; return x; } enum a = foo; void main() { } produces /home/D/Repo/dmd/generated/linux/release/64/../../../../../druntime/import/core/lifetime.d(2105): Error: `memcpy` cannot be interpreted at compile time, because it has no available source code with DMD64 D Compiler v2.096.1-242-g9fd50d0be The error seems to be in std.algorithm.sorting: shortSort. It has specialized routines for the cases <= 5 and is called for not too large ranges (here up to 256), depending on the size of the elements. With DMD64 D Compiler v2.090.1 it works. According to https://run.dlang.io/is/VM5Ufp it was introduced between 2.093.1 and 2.094.1.
Comment #1 by robert.schadek — 2024-12-01T16:38:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9822 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB