Skip to content

change backend_init code to workaround bug in VC optimizer#5037

Merged
WalterBright merged 1 commit intodlang:masterfrom
rainers:vcopt_backinit
Sep 5, 2015
Merged

change backend_init code to workaround bug in VC optimizer#5037
WalterBright merged 1 commit intodlang:masterfrom
rainers:vcopt_backinit

Conversation

@rainers
Copy link
Member

@rainers rainers commented Sep 5, 2015

The VC optimizer fails to change tysize[TYnref] when using optimized builds, all other entries seem ok.

This is clearly a MS compiler bug, but removing the non-looping loop seems to help avoid the troubles. Is there a reason to keep these loops running from 0 to 0?

I'm not sure why this worked before the frontend switch to D. Maybe the link time code generation uses a slightly different code generator.

I'm currently using VS2013 Update 4.

@rainers
Copy link
Member Author

rainers commented Sep 5, 2015

With this patch and #5010, I finally get a working (i.e. passing the test suite) release build using VC for the backend. Apart from better debugging, it generates faster code than dmc. Compile times for the D sources of ddmd with -m32 -O -inline using the respective dmd version:

  • dmd2.067: 45.3 s
  • dmd2.068.1: 46.3 s
  • git-master: 47.8 s
  • vc-win32: 38.3 s
  • vc-x64: 37.9 s

Building the debug version takes about 2 seconds, so I expect the additional time is spent in the optimizer.

@WalterBright
Copy link
Member

The strange loop is an anachronism from olden code.

WalterBright added a commit that referenced this pull request Sep 5, 2015
change backend_init code to workaround bug in VC optimizer
@WalterBright WalterBright merged commit 2c61836 into dlang:master Sep 5, 2015
@ibuclaw
Copy link
Member

ibuclaw commented Sep 5, 2015

The strange loop is an anachronism from olden code.

Which I expect would have been better written as 'do { ... } while (0)' some years later. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants