[Issue 15629] [REG2.066.0] wrong code with '-O -inline' but correct with '-O'
https://issues.dlang.org/show_bug.cgi?id=15629 --- Comment #9 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/6b54b4bcf6dfaa343992f3524e1bf15ffca07da3 fix Issue 15629 - [REG2.066.0] wrong code with '-O -inline' but correct with '-O' https://github.com/dlang/dmd/commit/b0d60736a583e22fc685cbc2b7f436e520073f91 Merge pull request #5666 from WalterBright/fix15629 --
[Issue 15629] [REG2.066.0] wrong code with '-O -inline' but correct with '-O'
https://issues.dlang.org/show_bug.cgi?id=15629 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 15629] [REG2.066.0] wrong code with '-O -inline' but correct with '-O'
https://issues.dlang.org/show_bug.cgi?id=15629 --- Comment #8 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6b54b4bcf6dfaa343992f3524e1bf15ffca07da3 fix Issue 15629 - [REG2.066.0] wrong code with '-O -inline' but correct with '-O' https://github.com/D-Programming-Language/dmd/commit/b0d60736a583e22fc685cbc2b7f436e520073f91 Merge pull request #5666 from WalterBright/fix15629 fix Issue 15629 - [REG2.066.0] wrong code with '-O -inline' but correct with '-O' --
[Issue 15629] [REG2.066.0] wrong code with '-O -inline' but correct with '-O'
https://issues.dlang.org/show_bug.cgi?id=15629 Walter Brightchanged: What|Removed |Added Hardware|x86 |All OS|Windows |All --- Comment #7 from Walter Bright --- https://github.com/D-Programming-Language/dmd/pull/5666 This is a serious bug. --
[Issue 15629] [REG2.066.0] wrong code with '-O -inline' but correct with '-O'
https://issues.dlang.org/show_bug.cgi?id=15629 Walter Brightchanged: What|Removed |Added Summary|[REG2.066.0] wrong code |[REG2.066.0] wrong code |with "-O -inline" but |with '-O -inline' but |correct with "-O" |correct with '-O' --
[Issue 15629] [REG2.066.0] wrong code with "-O -inline" but correct with "-O"
https://issues.dlang.org/show_bug.cgi?id=15629 Walter Brightchanged: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #6 from Walter Bright --- Comment 3 further reduces to: void main() { int[] a = [3]; int value = a[0] >= 0 ? a[0] : -a[0]; assert(a[0] == 3); writeln(value, a); } void writeln(int v, int[] a) { } and only -O is needed (not -inline). --
[Issue 15629] [REG2.066.0] wrong code with "-O -inline" but correct with "-O"
https://issues.dlang.org/show_bug.cgi?id=15629 Kenji Harachanged: What|Removed |Added Summary|[REG] wrong code with "-O |[REG2.066.0] wrong code |-inline" but correct with |with "-O -inline" but |"-O"|correct with "-O" --- Comment #4 from Kenji Hara --- (In reply to Kenji Hara from comment #3) > Dustmited case code: Sorry, the reduced code cannot reproduce exactly same regression with the original. I'll open one more issue for that. Correct minimized code is: void main() { int[] a = [3]; int value = abs(a[0]); assert(a[0] == 3); writeln(value, " ", a); } Num abs(Num)(Num x) { return x >= 0 ? x : -x; } struct File { struct LockingTextWriter { this(File) {} ~this() @trusted {} } auto lockingTextWriter() { return LockingTextWriter(); } } File stdout; void writeln(T...)(T args) { stdout.lockingTextWriter(); } Introduced in: https://github.com/D-Programming-Language/dmd/pull/3620 and its fixup PR: https://github.com/D-Programming-Language/dmd/pull/3656 So this is a regression from 2.066.0. --
[Issue 15629] [REG2.066.0] wrong code with "-O -inline" but correct with "-O"
https://issues.dlang.org/show_bug.cgi?id=15629 --- Comment #5 from Kenji Hara--- (In reply to Kenji Hara from comment #4) > Sorry, the reduced code cannot reproduce exactly same regression with the > original. > I'll open one more issue for that. Ah, I got understanding. The reduced case in comment#3 has generated wrong code with -inline, since the change by PR#4474: https://github.com/D-Programming-Language/dmd/pull/4474 However, comment#3 and comment#4 are essentially same. The only one difference is the parenthesis on stdout.lockingTextWriter(); in writeln template function. So, this wrong-code issue in the comment#3 case was hidden by issue 14264, and it's *fixed* by PR#4474. Therefore the two cases can hit this issue with current master. --