http://d.puremagic.com/issues/show_bug.cgi?id=2923
Summary: bug with -inline Product: D Version: 1.043 Platform: PC OS/Version: Windows Status: NEW Keywords: wrong-code Severity: normal Priority: P2 Component: DMD AssignedTo: bugzi...@digitalmars.com ReportedBy: xurux1-m...@yahoo.de adding the -inline option produces wrong output, both with Digital Mars D Compiler v1.043, Digital Mars D Compiler v2.029 on windows. import std.stdio; //writefln int my_abs(int i) { return i<0 ? -i : i; } void main(char[][] args) { int rows=9; int mid=5; for (int j=0; j<rows; j++) { int leadSpaces=my_abs((mid-1)-j); for (int i=0; i<leadSpaces; i++) writef("-"); //writefln("%d:%d",j,leadSpaces); writefln("!"); } } /* CORRECT: C:\dev\d>dmd -release -O -run compiler_bug1.d ----! ---! --! -! ! -! --! ---! ----! WRONG: C:\dev\d>dmd -release -O -inline -run compiler_bug1.d ! ! ! ! ! ! ! ! ! */ --