[Bug 207] _d_throw is not treated as `noreturn`.

via D.gnu d.gnu at puremagic.com
Sat Jan 9 03:40:31 PST 2016


http://bugzilla.gdcproject.org/show_bug.cgi?id=207

--- Comment #6 from art.08.09 at gmail.com ---
(In reply to Iain Buclaw from comment #5)
> As for assert(0) in non-release code, it is still possible to catch it, so
> there's not much in the way of optimising around that. :-)

It's not about catching -- marking it as noreturn doesn't affect
catching, just return/recovery. `assert(0)` is sufficiently special
in D that the compiler already complains when it finds reachable
code following such an assert:

   void f() {
      assert(0);
      f();       // warning: statement is not reachable
   }


> I can have a look, but as far as I recall, gcc optimizer should treat it as
> noreturn.  Whether or not noreturn implies that everything in scope
> afterwards is unreachable depends the optimizer too.

My guess is the calls are not treated as @noreturn, but, since gdc
dropped support for most gcc attributes, verifying this by wrapping
the calls is currently impossible...

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20160109/07884f2a/attachment.html>


More information about the D.gnu mailing list