Bug 2710 – dmd2/src/druntime/src/../import/std/intrinsic.di misses pure and nothrow in signatures

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-03-06T10:46:00Z
Last change time
2015-06-09T05:14:57Z
Assigned to
bugzilla
Creator
witold.baryluk+d

Comments

Comment #0 by witold.baryluk+d — 2009-03-06T10:46:50Z
When compiling druntime with dmd2, gc/bacis/gcbits.d calls std.intrinsic.btr, which signatures is in ../import/std/intrinsic.di compiler don't emit proper code. Considering that file src/dmd/toir.c have on line 380 signature 9intrinsic3btrFNbPkkZi and that inspecting object file of gcbits.o I concluded that D compiler isn't emiting proper code because intrinsic.di had missing "nothrow and pure" keywords in few places. Druntime compiles (because there can be unresolved symbls), but then compiling phobos' unittest fails (because it links against everything and fails to find 9intrinsic3btrFPkkZi (which is for DMD1, and defined nowhere). Solution, edit ../import/std/intrinsic.di and ensure there are this signatures (as in phobos sources). nothrow: pure nothrow int bsf( uint v ); pure nothrow int bsr( uint v ); pure nothrow int bt( const uint* p, uint bitnum ); pure uint bswap( uint v ); I also concluded that intrinsic.di wasn't generated automatically from phobos' sources (-H switch), because dmd is generating proper (and much more compacted) version of code. This is rationall because there is no source files for it (intrinsic.d in phobos contains only declarations, but proper ones).
Comment #1 by witold.baryluk+d — 2009-03-06T10:56:16Z
Ok, I think druntime version r107 solved this problem.