Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

koch fails to boot nim with VCC compile backend #6229

Open
fredrikhr opened this issue Aug 10, 2017 · 6 comments
Open

koch fails to boot nim with VCC compile backend #6229

fredrikhr opened this issue Aug 10, 2017 · 6 comments

Comments

@fredrikhr
Copy link
Contributor

When booting the nim compiler with the koch utility, by using koch boot -d:release to produces a release build, it critically fails in the 2nd iteration.

msgs.nim(602, 32) Error: ambiguous call; both tables.[](t: var Table[[].A, [].B], key: A)[declared in lib\pure\collections\tables.nim(167, 5)] and tables.[](t: Table[[].A, [].B], key: A)[declared in lib\pure\collections\tables.nim(161, 5)] match for: (Table[system.string, system.int32], string)

According to @Araq, this is a regression caused by MSVC that miscompiles nim in the first iteration.

@Araq also stated on IRC that the issue is caused in compiler/semcall.nim (line 70) where MSVC appearently prematurely collects an important data structure in an attempt to optimize away the stack root.

This error does not occur when running koch boot which produces a non-optimized version of the compiler.

This currently makes it impossible to produce a release build of Nim with the VCC compiler backend.

@cooldome
Copy link
Member

please specify VS version

@fredrikhr
Copy link
Contributor Author

@cooldome VS2017

@barcharcraz
Copy link
Contributor

I have had this issue as well.

setting vcc.exe to "clang-cl" (and having clang installed ofc) fixes it. So it may be an actual codegen regression and not a well-known bug in msvc

@fredrikhr
Copy link
Contributor Author

This now works fine with booting Nim for x86 using koch boot -d:release --cpu:i386.

@fredrikhr
Copy link
Contributor Author

I can however confirm that the same error still occurs when using vcc and booting nim for x64 with (as per the time of this comment) the newest commit on origin/devel

@nc-x
Copy link
Contributor

nc-x commented Jun 15, 2019

It now builds fine with -d:release but not with -d:danger.

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

No branches or pull requests

5 participants