Annoyance with new integer promotion deprecations

Walter Bright newshound2 at digitalmars.com
Tue Feb 6 20:23:02 UTC 2018


On 2/5/2018 10:08 PM, H. S. Teoh wrote:
> IMO, we should extend this past just one statement. It would lead to
> more possibilities for optimizations and possibly other features too.
> Though I understand that Walter has reservations about doing this for
> some reason.

What you're asking for is data flow analysis. DFA's effectiveness is definitely 
a quality of implementation thing. But if you want to have a successful compile 
depend on DFA, then you've got to define in the Specification exactly what DFA 
is done.

The next problem is DFA is a complex thing. This is why DFA is done on the 
vastly simplified and canonicalized intermediate code, not the ASTs. With dmd's 
inliner, I made the mistake of doing inlining of the ASTs (other compilers do it 
with the intermediate code). This was a major error, and has led to all kinds of 
peculiar bugs and shortcomings. I'm not going to make that mistake again.

Doing DFA for VRP means doing it on the ASTs.

I know what you're asking for sounds simple enough. But it ain't.


More information about the Digitalmars-d mailing list