[Issue 9623] New: Illegal Win64 linker optimization?
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Mar  1 11:30:20 PST 2013
    
    
  
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: nobody at puremagic.com
        ReportedBy: code at dawg.eu
--- Comment #0 from Martin Nowak <code at dawg.eu> 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: -------
    
    
More information about the Digitalmars-d-bugs
mailing list