www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 207] New: _d_throw is not treated as `noreturn`.

Date: Sat, 9 Jan 2016 06:09:11 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"


            Bug ID: 207
           Summary: _d_throw is not treated as `noreturn`.
           Product: GDC
           Version: development
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw gdcproject.org
          Reporter: art.08.09 gmail.com

`throw expr;` is not assumed to never return.

This results in *much* worse codegen, which can be seen by substituting

 { throw expr; import gcc.builtins; __builtin_unreachable(); }
 throw expr;
That is not a perfect workaround, as the compiler then warns about that `builtin_unreachable()` statement being unreachable (but at least does the right thing and eliminates the unreachable paths). Using `assert(0)` works, but adds unnecessary bloat (the dead trap code in release mode). -- You are receiving this mail because: You are watching all bug changes.
Jan 08 2016