January 09, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=207

            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(); }

for

> 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.