Bug 2232 – DMD generates invalid code when an object file is compiled -inline

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2008-07-16T15:53:00Z
Last change time
2014-03-01T00:36:58Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
schveiguy

Attachments

IDFilenameSummaryContent-TypeSize
262Path.dPath.d filetext/plain3378
263testpath.dmain programtext/plain274

Comments

Comment #0 by schveiguy — 2008-07-16T15:53:59Z
The attached files when compiled in this manner: dmd -c -O -inline Path.d dmd testpath.d Path.obj Will yield an executable that corrupts the return value from the 'modified', 'accessed', and 'created' functions. I'm also printing out the values when they are read from the OS as a comparison. If the Path object file is compiled without -inline, it works. If you compile Path and testpath all at once with -inline, it works. If you change e.g. created() to use a temporary variable to store the return value, it works. This is the most minimal example I could create, it happens with both Phobos and Tango, this example is for Phobos. The code comes from tango.io.Path.d
Comment #1 by schveiguy — 2008-07-16T15:55:03Z
Created attachment 262 Path.d file Compile this file with -c -inline -O
Comment #2 by schveiguy — 2008-07-16T15:55:46Z
Created attachment 263 main program compile this with Path.obj using dmd testpath.d Path.obj
Comment #3 by bugzilla — 2008-09-03T01:35:37Z
Fixed dmd 1.035 and 2.019