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

           Summary: Illegal Win64 linker optimization?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Martin Nowak <[email protected]> 2013-03-01 11:30:18 PST ---
debug=PRINTF;
debug(PRINTF) import core.stdc.stdio;

int foo()()
{
    return 0;
}

int bar()()
{
    return 0;
}

void main()
{
     auto f1 = &foo!();
     auto f2 = &bar!();
     debug(PRINTF) printf("%p %p\n", f1, f2);
     assert(f1 !is f2);
}

----

Because identical COMDAT folding (/OPT:ICF) is enabled by default this will
assert. When compiled with '-g' we pass '/DEBUG' to the linker which also
disables ICF so the assertion passes.
This could lead to difficult to track down bug when function pointer comparison
is used, e.g. as key to an AA.

http://msdn.microsoft.com/en-us//library/bxwfs976(v=vs.110).aspx#alert_note

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to