[Issue 2232] New: DMD generates invalid code when an object file is compiled -inline

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 16 13:54:03 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2232

           Summary: DMD generates invalid code when an object file is
                    compiled -inline
           Product: D
           Version: 1.033
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: schveiguy at yahoo.com


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


-- 



More information about the Digitalmars-d-bugs mailing list