Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang: error: clang frontend command failed due to signal: gcc style inline asm #14340

Open Quuxplusone opened 11 years ago

Quuxplusone commented 11 years ago
Bugzilla Link PR14430
Status NEW
Importance P normal
Reported by Peeter Joot (peeter.joot@gmail.com)
Reported on 2012-11-24 09:13:31 -0800
Last modified on 2012-11-24 15:56:57 -0800
Version trunk
Hardware PC Linux
CC echristo@gmail.com, llvm-bugs@lists.llvm.org, pawel@32bitmicro.com, stoklund@2pi.dk
Fixed by commit(s)
Attachments t-CDxuHx.cpp (205110 bytes, text/plain)
t-CDxuHx.sh (480 bytes, application/octet-stream)
Blocks
Blocked by
See also
Created attachment 9592
first attachment: preprocessed source

clang:
/home/hotellnx99/peeterj/tmp/clang/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1261:
void {anonymous}::TwoAddressInstructionPass::processTiedPairs(l
lvm::MachineInstr*, {anonymous}::TwoAddressInstructionPass::TiedPairList&,
unsigned int&): Assertion `i == DstIdx || !MI->getOperand(i).isReg() || MI-
>getOper
and(i).getReg() != RegA' failed.
0  clang           0x0000000001fae83f
1  clang           0x0000000001faed39
2  libpthread.so.0 0x00002b3ad2e8ee00
3  libc.so.6       0x00002b3ad3541f45 gsignal + 53
4  libc.so.6       0x00002b3ad3543340 abort + 272
5  libc.so.6       0x00002b3ad353b486 __assert_fail + 246
6  clang           0x0000000001a7d235
7  clang           0x0000000001a81fca
8  clang           0x0000000001f45c1f
llvm::FPPassManager::runOnFunction(llvm::Function&) + 655
9  clang           0x0000000001f45c73
llvm::FPPassManager::runOnModule(llvm::Module&) + 51
10 clang           0x0000000001f4591f
llvm::MPPassManager::runOnModule(llvm::Module&) + 575
11 clang           0x0000000001f4900f llvm::PassManagerImpl::run(llvm::Module&)
+ 175
12 clang           0x00000000007ed664
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::La
ngOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) +
3668
13 clang           0x00000000007eb31f
14 clang           0x0000000000940eba clang::ParseAST(clang::Sema&, bool, bool)
+ 554
15 clang           0x00000000007e9f1e clang::CodeGenAction::ExecuteAction() + 78
16 clang           0x000000000067c8c6 clang::FrontendAction::Execute() + 150
17 clang           0x000000000065fae5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 341
18 clang           0x00000000006471fd
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1421
19 clang           0x000000000063f128 cc1_main(char const**, char const**, char
const*, void*) + 1160
20 clang           0x00000000006465fa main + 4842
21 libc.so.6       0x00002b3ad352f304 __libc_start_main + 244
22 clang           0x000000000063dff9
Stack dump:
0.      Program arguments: /home/hotellnx99/peeterj/local/bin/clang -cc1 -
triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name t.C -
mreloca
tion-model static -fmath-errno -masm-verbose -mconstructor-aliases -munwind-
tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.16.91.0.5 -
mom
it-leaf-frame-pointer -resource-dir
/home/hotellnx99/peeterj/local/bin/../lib/clang/3.3 -fmodule-cache-path
/home/hotellnx99/peeterj/tmp/clang-module-cache -i
nternal-isystem /home/hotellnx99/peeterj/local/lib/gcc/x86_64-unknown-linux-
gnu/4.7.2/../../../../include/c++/4.7.2 -internal-isystem
/home/hotellnx99/peeterj
/local/lib/gcc/x86_64-unknown-linux-
gnu/4.7.2/../../../../include/c++/4.7.2/x86_64-unknown-linux-gnu -internal-
isystem /home/hotellnx99/peeterj/local/lib/gcc/
x86_64-unknown-linux-gnu/4.7.2/../../../../include/c++/4.7.2/backward -internal-
isystem /usr/local/include -internal-isystem /home/hotellnx99/peeterj/local/bi
n/../lib/clang/3.3/include -internal-externc-isystem /include -internal-externc-
isystem /usr/include -O2 -fdeprecated-macro -fdebug-compilation-dir /vbs/commo
n/osse/core/t -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-
runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o
/home/hotellnx9
9/peeterj/tmp/t-tYuE1R.o -x c++ t.C
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 't.C'.
4.      Running pass 'Two-Address instruction pass' on function
'@_Z9callcpuidP8cpuidOutl'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (trunk 168392)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run scri
pt.
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /home/hotellnx99/peeterj/tmp/t-CDxuHx.cpp
clang: note: diagnostic msg: /home/hotellnx99/peeterj/tmp/t-CDxuHx.sh
Quuxplusone commented 11 years ago

Attached t-CDxuHx.cpp (205110 bytes, text/plain): first attachment: preprocessed source

Quuxplusone commented 11 years ago

Attached t-CDxuHx.sh (480 bytes, application/octet-stream): second attachment: command line

Quuxplusone commented 11 years ago
Note that the code in question doesn't actually compile with g++ either:

void callcpuid( cpuidOut * p, long a )
{
//   memset( p, 0xFF, sizeof(*p) ) ;
   p->a = a ;

   __asm__ ( "cpuid"
             : "+a"(p->a), "=b"(p->b), "=c"(p->c), "=d"(p->d)  // output
             :                                                 // no (only) inputs
             : "%rax", "%rbx", "%rcx", "%rdx"                  // clobbered registers
           ) ;
//             : "a", "b", "c", "d"                              // clobbered
registers
}

... but gcc produces a diagnostic message instead of trapping.