Ryan Taylor
2012-Feb-13 22:57 UTC
[LLVMdev] Error compiling simple loop, Casting.h used by Polly
clang:
/home/ryan/llvm/llvm_core/llvm-3.0/include/llvm/Support/Casting.h:194:
typename cast_retty<PHINode, ilist_iterator<Instruction> >::ret_type
llvm::cast(const llvm::ilist_iterator<llvm::Instruction> &): Assertion
`isa<X>(Val) && "cast<Ty>() argument of incompatible
type!"' failed.
0 clang 0x0000000001b3618f
1 clang 0x0000000001b366a9
2 libpthread.so.0 0x00007f5b07d3bc60
3 libc.so.6 0x00007f5b07026d05 gsignal + 53
4 libc.so.6 0x00007f5b0702aab6 abort + 390
5 libc.so.6 0x00007f5b0701f7c5 __assert_fail + 245
6 LLVMPolly.so 0x00007f5b06dae9b8
7 clang 0x0000000001ad97cf
llvm::FPPassManager::runOnFunction(llvm::Function&) + 351
8 clang 0x0000000001ad9059
llvm::FunctionPassManagerImpl::run(llvm::Function&) + 329
9 clang 0x0000000001ad8edb
llvm::FunctionPassManager::run(llvm::Function&) + 139
10 clang 0x000000000076cd6c
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 5004
11 clang 0x000000000076ad83
12 clang 0x0000000000884700 clang::ParseAST(clang::Sema&, bool) +
448
13 clang 0x000000000076a1fb clang::CodeGenAction::ExecuteAction()
+ 859
14 clang 0x000000000062b63d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 957
15 clang 0x00000000006147d7
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2247
16 clang 0x000000000060b81f cc1_main(char const**, char const**,
char const*, void*) + 2991
17 clang 0x0000000000610c35 main + 757
18 libc.so.6 0x00007f5b07011eff __libc_start_main + 255
19 clang 0x000000000060abad
Stack dump:
0. Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-llvm -disable-free -main-file-name loop1.c
-mrelocation-model static -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.21.0.20110327
-momit-leaf-frame-pointer -coverage-file loop1.c.ll -resource-dir
/usr/local/bin/../lib/clang/3.1 -fmodule-cache-path
/var/tmp/clang-module-cache -internal-isystem /usr/local/include
-internal-isystem /usr/local/bin/../lib/clang/3.1/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-O3 -fdebug-compilation-dir /home/ryan/llvm/llvm_core/llvm-3.0
-ferror-limit 19 -fmessage-length 100 -mstackrealign -fgnu-runtime
-fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fdiagnostics-show-option -fcolor-diagnostics -load
/home/ryan/llvm/llvm_core/llvm-3.0/tools/polly/Release+Asserts/lib/LLVMPolly.so
-mllvm -polly -o loop1.c.ll -x c loop1.c
1. <eof> parser at end of file
2. Per-function optimization
3. Running pass 'Polly - Prepare code for polly' on function
'@func'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/loop1-xX24bI.i
clang: note: diagnostic msg: /tmp/loop1-xX24bI.sh
This code was running fine earlier today before I "up"'d the svn
checkout
for everything (polly, clang, llvm) and reinstalled updated cloog. I have
attached a test case.
I am compiling with this:
clang -Xclang -load -Xclang ${PATH_TO_POLLY_LIB}LLVMPolly.so $1 -mllvm
-polly -O3 -S -emit-llvm
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20120213/95cce83d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loop1.c
Type: text/x-csrc
Size: 122 bytes
Desc: not available
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20120213/95cce83d/attachment.c>
Alexander Potapenko
2012-Apr-20 13:02 UTC
[LLVMdev] Error compiling simple loop, Casting.h used by Polly
Hi Ryan, Is there a PR about this? I've just hit the same assertion with AddressSanitizer, http://code.google.com/p/address-sanitizer/issues/detail?id=67 On Tue, Feb 14, 2012 at 2:57 AM, Ryan Taylor <ryta1203 at gmail.com> wrote:> clang: > /home/ryan/llvm/llvm_core/llvm-3.0/include/llvm/Support/Casting.h:194: > typename cast_retty<PHINode, ilist_iterator<Instruction> >::ret_type > llvm::cast(const llvm::ilist_iterator<llvm::Instruction> &): Assertion > `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed. > 0 clang 0x0000000001b3618f > 1 clang 0x0000000001b366a9 > 2 libpthread.so.0 0x00007f5b07d3bc60 > 3 libc.so.6 0x00007f5b07026d05 gsignal + 53 > 4 libc.so.6 0x00007f5b0702aab6 abort + 390 > 5 libc.so.6 0x00007f5b0701f7c5 __assert_fail + 245 > 6 LLVMPolly.so 0x00007f5b06dae9b8 > 7 clang 0x0000000001ad97cf > llvm::FPPassManager::runOnFunction(llvm::Function&) + 351 > 8 clang 0x0000000001ad9059 > llvm::FunctionPassManagerImpl::run(llvm::Function&) + 329 > 9 clang 0x0000000001ad8edb > llvm::FunctionPassManager::run(llvm::Function&) + 139 > 10 clang 0x000000000076cd6c > clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions > const&, clang::TargetOptions const&, clang::LangOptions const&, > llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 5004 > 11 clang 0x000000000076ad83 > 12 clang 0x0000000000884700 clang::ParseAST(clang::Sema&, bool) + > 448 > 13 clang 0x000000000076a1fb clang::CodeGenAction::ExecuteAction() > + 859 > 14 clang 0x000000000062b63d > clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 957 > 15 clang 0x00000000006147d7 > clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2247 > 16 clang 0x000000000060b81f cc1_main(char const**, char const**, > char const*, void*) + 2991 > 17 clang 0x0000000000610c35 main + 757 > 18 libc.so.6 0x00007f5b07011eff __libc_start_main + 255 > 19 clang 0x000000000060abad > Stack dump: > 0. Program arguments: /usr/local/bin/clang -cc1 -triple > x86_64-unknown-linux-gnu -emit-llvm -disable-free -main-file-name loop1.c > -mrelocation-model static -masm-verbose -mconstructor-aliases > -munwind-tables -target-cpu x86-64 -target-linker-version 2.21.0.20110327 > -momit-leaf-frame-pointer -coverage-file loop1.c.ll -resource-dir > /usr/local/bin/../lib/clang/3.1 -fmodule-cache-path > /var/tmp/clang-module-cache -internal-isystem /usr/local/include > -internal-isystem /usr/local/bin/../lib/clang/3.1/include > -internal-externc-isystem /usr/include/x86_64-linux-gnu > -internal-externc-isystem /include -internal-externc-isystem /usr/include > -O3 -fdebug-compilation-dir /home/ryan/llvm/llvm_core/llvm-3.0 -ferror-limit > 19 -fmessage-length 100 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc > -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option > -fcolor-diagnostics -load > /home/ryan/llvm/llvm_core/llvm-3.0/tools/polly/Release+Asserts/lib/LLVMPolly.so > -mllvm -polly -o loop1.c.ll -x c loop1.c > 1. <eof> parser at end of file > 2. Per-function optimization > 3. Running pass 'Polly - Prepare code for polly' on function '@func' > clang: error: unable to execute command: Aborted > clang: error: clang frontend command failed due to signal (use -v to see > invocation) > clang: note: diagnostic msg: Please submit a bug report to > http://llvm.org/bugs/ and include command line arguments and all diagnostic > information. > clang: note: diagnostic msg: Preprocessed source(s) and associated run > script(s) are located at: > clang: note: diagnostic msg: /tmp/loop1-xX24bI.i > clang: note: diagnostic msg: /tmp/loop1-xX24bI.sh > > This code was running fine earlier today before I "up"'d the svn checkout > for everything (polly, clang, llvm) and reinstalled updated cloog. I have > attached a test case. > > I am compiling with this: > > clang -Xclang -load -Xclang ${PATH_TO_POLLY_LIB}LLVMPolly.so $1 -mllvm > -polly -O3 -S -emit-llvm > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Alexander Potapenko Software Engineer Google Moscow
Tobias Grosser
2012-Apr-20 14:09 UTC
[LLVMdev] Error compiling simple loop, Casting.h used by Polly
On 04/20/2012 03:02 PM, Alexander Potapenko wrote:> Hi Ryan, > > Is there a PR about this? I've just hit the same assertion with > AddressSanitizer, > http://code.google.com/p/address-sanitizer/issues/detail?id=67I am not sure if this is a general LLVM bug. It rather seems both Polly and AdressSanitizer try to generate an invalid cast. If you can reproduce this bug, it should be easy to understand. I would guess there is an IRBuilder somewhere in the backtrace, which is used to generate a cast. The types are probably incompatible. Unfortunately the backtrace from Ryan does not contain any debugging symbols and on the .c file I cannot reproduce the problem. Let me know if you found out what was the problem. Cheers Tobi