[LLVMdev] LLVM 2.9 64bits on Visual Studio 9

9 views
Skip to first unread message

glei...@gmail.com

unread,
Aug 11, 2011, 8:22:29 AM8/11/11
to llv...@cs.uiuc.edu
Hello everybody,

I have sucessfully compiled LLVM with CMAKE generator "Visual Studio 9 2008 Win64" (OS Windows 7).

-But when I run the Fibonacci example program in "release" mode, I get a crash with this visual studio popup message :
Microsoft Visual Studio C Runtime Library has detected a fatal error in Fibonacci.exe.

-Here is the visual studio output:
'Fibonacci.exe': Loaded 'C:\Users\IUC\Desktop\BUILD_64\bin\Release\Fibonacci.exe', Binary was not built with debug information.
'Fibonacci.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'Fibonacci.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'Fibonacci.exe': Loaded 'C:\Windows\System32\KernelBase.dll'
'Fibonacci.exe': Loaded 'C:\Windows\winsxs\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4967_none_08e58abba83c6451\msvcp90.dll'
'Fibonacci.exe': Loaded 'C:\Windows\winsxs\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4967_none_08e58abba83c6451\msvcr90.dll'
'Fibonacci.exe': Loaded 'C:\Windows\System32\dbghelp.dll'
'Fibonacci.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
Microsoft Visual Studio C Runtime Library has detected a fatal error in Fibonacci.exe.

Press Break to debug the program or Continue to terminate the program.

-And here is the callstack in release mode :(:
> msvcr90.dll!000000006a8b9f48()
[Frames below may be incorrect and/or missing, no symbols loaded for msvcr90.dll]
msvcr90.dll!000000006a8b52a5()
msvcr90.dll!000000006a8b52f5()
Fibonacci.exe!000000013ffac08e()
Fibonacci.exe!00000001401551fd()
Fibonacci.exe!00000001401564d0()
Fibonacci.exe!0000000140156852()
Fibonacci.exe!000000013fdb7180()
Fibonacci.exe!000000013fdb749b()
Fibonacci.exe!000000013fdb7913()
Fibonacci.exe!000000013fda2231()
Fibonacci.exe!00000001401bfa82()
kernel32.dll!0000000076bdf56d()
ntdll.dll!0000000076e12cc1()


It crashes after IR compilation when calling the JIT, the last program message is :
starting fibonacci(24) with JIT...

Please also note that it works fine in debug mode.
Seems to be a bug, but maybe I have missed something.. any idea would be really appreciated :)
Thanks!
Damien

NAKAMURA Takumi

unread,
Aug 14, 2011, 9:44:41 PM8/14/11
to glei...@gmail.com, llv...@cs.uiuc.edu
FYI, I have confirmed it works on VS10SP1 with x64|Release.

E:\llvm\build\cmake-x64-vs10>bin\Release\Fibonacci.exe 24
verifying... OK
We just constructed this LLVM module:

---------
; ModuleID = 'test'
(snip)
---------
starting fibonacci(24) with JIT...
Result: 46368

...Takumi


2011/8/11 <glei...@gmail.com>:

_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Damien Gleizes

unread,
Aug 24, 2011, 6:53:45 AM8/24/11
to llv...@cs.uiuc.edu

Hi,

Thank you for your reply.
I did not try with VS2010, maybe the issue is only with VS2009 (and/or some
SP). As it works in Debug mode, at first sight I would say it is a project
configuration issue?

I have done some little debugging, and it seems to crash in the function
LiveVariable::runOnMachineFunction, on the call to VirtRegInfo[Reg].

In the assembly code, we can see the compiler first checks that the Reg
variable is in the range of the VirtRegInfo map, but it says no... although
a call to VirtRegInfo.inBounds(Reg) returns true!

Just as if the test in the assembly code was not done on the correct
value... so I try to add a volatile keyword on the Reg variable declaration,
and then it works correctly (I have replaced all variable handling the
result of TargetRegisterInfo::index2VirtReg with a volatile variable)...

...but no idea why it is working with this change :/

Damien

--
View this message in context: http://old.nabble.com/LLVM-2.9-64bits-on-Visual-Studio-9-tp32241633p32325469.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.

Reply all
Reply to author
Forward
0 new messages