[Issue 12503] Bad optimization with scope(success) and return statement
https://issues.dlang.org/show_bug.cgi?id=12503 --- Comment #4 from github-bugzi...@puremagic.com --- Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/31d0aa4f61ed1ab051c4b48bee235d5d3d0002c0 Merge pull request #3826 from yebblies/issue12503 Issue 12503 - Bad optimization with scope(success) and return statement --
[Issue 12503] Bad optimization with scope(success) and return statement
https://issues.dlang.org/show_bug.cgi?id=12503 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 12503] Bad optimization with scope(success) and return statement
https://issues.dlang.org/show_bug.cgi?id=12503 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ee659d780bcc2b2d6c29c3930cc122ff481e9465 Fix Issue 12503 - Bad optimization with scope(success) and return statement The current code only lists the finally block as a successor of the return statement when the return directly inside the finally's try block. https://github.com/D-Programming-Language/dmd/commit/426845f8efa66f85300fad4539faf57b24e1 Merge pull request #3826 from yebblies/issue12503 Issue 12503 - Bad optimization with scope(success) and return statement --
[Issue 12503] Bad optimization with scope(success) and return statement
https://issues.dlang.org/show_bug.cgi?id=12503 yebblies yebbl...@gmail.com changed: What|Removed |Added Keywords||pull CC||yebbl...@gmail.com Assignee|nob...@puremagic.com|yebbl...@gmail.com --- Comment #2 from yebblies yebbl...@gmail.com --- The glue layer sets up the block successors wrong. https://github.com/D-Programming-Language/dmd/pull/3826 --
[Issue 12503] Bad optimization with scope(success) and return statement
https://issues.dlang.org/show_bug.cgi?id=12503 --- Comment #1 from Kenji Hara k.hara...@gmail.com --- The lowered code generated by front-end will cause same issue. void fun(string a) { string b = a; bool __os1 = false; try { try { a = null; return ; } catch (Throwable __o2) { __os1 = true; throw __o2; } } finally { if (!__os1) assert(a != b); } } void main() { fun(foo); } It seems to be caused by copy propagation in dmd-backed optimizer, done by copyprop() in dmd/src/backend/gopher.c. --