www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: thomas-dloop 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


-- 
Dec 23 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=727


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




------- Comment #1 from bugzilla digitalmars.com  2007-10-31 21:50 -------
Works dmd 1.022 and 2.006.


-- 
Oct 31 2007