Bug 10849 – [profile+nothrow] -profile flag results in compiler errors with std.parallelism
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-18T21:16:00Z
Last change time
2015-06-09T05:14:42Z
Assigned to
nobody
Creator
tcdknutson
Comments
Comment #0 by tcdknutson — 2013-08-18T21:16:18Z
Compiling a program with DMD with the compiler switch -profile will result in the compiler error "Error: asm statements are assumed to throw" if std.parallelism components are used; namely taskPool.parallel().
Tested with DMD version 2.063 and the Phobos that ships with it.
For example:
cat test.d
```
import std.stdio;
import std.range : iota;
import std.parallelism : taskPool;
void main() {
int sum = 0;
foreach(i; taskPool.parallel(iota(10)))
{
sum += i;
}
}
```
dmd -profile test.d
```
src\druntime\import\core\atomic.d(500): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(501): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(502): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(503): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(392): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(393): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(394): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(395): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(396): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(455): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(456): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(279): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(280): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(281): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(282): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(283): Error: asm statements are assumed to throw
src\druntime\import\core\atomic.d(284): Error: asm statements are assumed to throw
```
Comment #1 by verylonglogin.reg — 2013-11-07T12:15:26Z
*** This issue has been marked as a duplicate of issue 11471 ***