[Issue 727] New: -inline: missing return in short function causes incorrect code generation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 23 05:09:08 PST 2006


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

           Summary: -inline: missing return in short function causes
                    incorrect code generation
           Product: D
           Version: 0.177
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


#
# int test(int i){
#    if(i==0){
#       return 2;
#    }
# }
#
# int main(){
#    assert(test(0)==2);
#    try{
#       test(1);
#    }catch{
#       return 0;
#    }
#    assert(0);
# }
#

success:
dmd return_06.d && ./return_06 

failure:
dmd -inline return_06.d && ./return_06

GDC isn't affected by this.

test case:
http://dstress.kuehne.cn/run/return_06.d


-- 



More information about the Digitalmars-d-bugs mailing list