[Issue 11461] New: `Error`s are not thrown as `pure nothrow` functions are optimized out with "-O -release"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 7 00:15:16 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11461

           Summary: `Error`s are not thrown as `pure nothrow` functions
                    are optimized out with "-O -release"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-11-07 11:15:14 MSK ---
This program runs without errors if compiled with "-O -release" and `f` is
strongly pure and `nothrow`:
---
void f() pure nothrow
{ throw new Error(""); }

void main()
{ f(); }
---

So optimizer must not completely optimize out even `nothrow` strongly pure
function calls as an `Error` still could be thrown or there could be a HLT
instruction.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list