[dmd-internals] Asserts

Don Clugston dclugston at gmail.com
Mon Nov 12 01:52:32 PST 2012


On 11 November 2012 20:50, Walter Bright <walter at digitalmars.com> wrote:
> The bulk of the bugs result from an incomplete understanding of how the
> various semantics of the language interact with each other. For example,
> behavior X of the language is accounted for in this section of code, but not
> that section. What has helped with this is what Andrei calls "lowering" -
> rewriting complex D code into a simpler equivalent, and then letting the
> simpler compiler routines deal with it.

A bit off-topic, but I don't agree that lowering has actually helped.
The problem is that the compiler frequently lowers things into
constructions which are not valid D code. Most obviously, variable
declararations inside comma expressions, and local ref variables. The
inliner does a lot of that as well.
A significant fraction of the CTFE bugs are caused by this.  Although
lowering definitely helps in some cases, I don't think it's a nett
win.


More information about the dmd-internals mailing list