https://d.puremagic.com/issues/show_bug.cgi?id=11506
Walter Bright <bugzi...@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzi...@digitalmars.com --- Comment #4 from Walter Bright <bugzi...@digitalmars.com> 2013-11-13 12:22:31 PST --- Yes, bearophile's right, I forgot about nothrow. But the compiler is a bit conservative by requiring nothrow. For throwing pure functions, the foo()+foo() case can still be replaced with 2*foo() if the arguments to foo are identical, even if foo throws. The obvious case of this is the no-argument case, which bearophile mentioned. Also, if foo() returns memory that it new'd, it cannot be elided: pure nothrow string foo(); return foo() ~ foo(); so things are a bit complicated, but there's still optimization opportunity. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------