[dmd-internals] Internal compiler error handling

Михаил Страшун via dmd-internals dmd-internals at puremagic.com
Wed Sep 28 05:19:48 PDT 2016


On 09/27/2016 11:40 AM, Mathias Lang via dmd-internals wrote:
> Hello DMD devs,
> 
> Since we switched to DDMD, there has been a major regression hanging
> around: asserts are stripped out of the version we ship (except for
> assert(0)), because for performance reason we ship with `-release`.
> This can lead to very subtle and hard to spot bug in user code, and
> requiring someone to build a debug version of DMD in order to post a bug
> report is a clear red flag.

It is actually worse than that because if any of non-assert(0) check
fails, developer want even see any clear ICE - it may or may not crash
in some random place later.

Because of that issue we currently have no idea how many ICE issues may
still remain in the frontend part.

> There has been discussions on what to do with this, in this P.R. :
> https://github.com/dlang/dmd/pull/5716

I must admit I was sure this PR got merged long time ago. The fact that
Martin decided 5% performance is more important than risk of generating
wrong code is worrying :(

> One other solution - which doesn't require a language change - would be
> to use exception for ICE (which are rare anyway)

Would be interesting to check all usage of `assert` and see:

a) how many of them protect from something truly bad
b) are there many "real" asserts (i.e. not assert(0)) in general


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 480 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20160928/b7a2aa40/attachment.sig>


More information about the dmd-internals mailing list