[LLVMbugs] [Bug 9682] New: Assert generating when legalizing types in __sync_val_compare_and_swap_16

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 11 13:31:04 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9682

           Summary: Assert generating when legalizing types in
                    __sync_val_compare_and_swap_16
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: mburke at ea.com
                CC: llvmbugs at cs.uiuc.edu


Given this C program:

typedef __uint128_t uint128_t;

uint128_t AtomicFetch(volatile uint128_t *ptr)
{
    return (uint128_t)__sync_val_compare_and_swap_16((volatile __int128_t
*)ptr, 0, 0);
}

When building with clang on linux x64, the following assert is generated:


mburke at D1018130-linux:~/src/tmp$ ../build/Release+Asserts/bin/clang -c test.c
ExpandIntegerResult #0: 0x34d8160: i128,ch = AtomicCmpSwap 0x34d7c60,
0x34d7860, 0x34d8060, 0x34d8060<Volatile LDST16[%tmp](align=8)> [ORD=3] [ID=0]

Do not know how to expand the result of this operator!
UNREACHABLE executed at
/home/mburke/src/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:982!
0  clang           0x0000000001824e3f
1  clang           0x00000000018270b2
2  libpthread.so.0 0x00007f46c3df1b40
3  libc.so.6       0x00007f46c30efba5 gsignal + 53
4  libc.so.6       0x00007f46c30f36b0 abort + 384
5  clang           0x0000000001810884 llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 356
6  clang           0x0000000001336226
7  clang           0x00000000012dbe64
8  clang           0x00000000012dc877 llvm::SelectionDAG::LegalizeTypes() + 471
9  clang           0x0000000001291d43
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 579
10 clang           0x00000000012945c6
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 262
11 clang           0x0000000001294f1a
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2330
12 clang           0x0000000001296388
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 520
13 clang           0x0000000001774f2b
llvm::FPPassManager::runOnFunction(llvm::Function&) + 587
14 clang           0x000000000177502b
llvm::FPPassManager::runOnModule(llvm::Module&) + 75
15 clang           0x0000000001774a27
llvm::MPPassManager::runOnModule(llvm::Module&) + 503
16 clang           0x0000000001774bbb llvm::PassManagerImpl::run(llvm::Module&)
+ 187
17 clang           0x000000000078811e
18 clang           0x0000000000788efd
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 189
19 clang           0x0000000000785b0b
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 251
20 clang           0x00000000008b24cd clang::ParseAST(clang::Sema&, bool) + 413
21 clang           0x0000000000784e84 clang::CodeGenAction::ExecuteAction() +
68
22 clang           0x0000000000675dd3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 371
23 clang           0x000000000064ed24
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1268
24 clang           0x0000000000645c0b cc1_main(char const**, char const**, char
const*, void*) + 683
25 clang           0x000000000064db35 main + 6277
26 libc.so.6       0x00007f46c30dad8e __libc_start_main + 254
27 clang           0x0000000000644179
Stack dump:
0.    Program arguments: /home/mburke/src/build/Release+Asserts/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name test.c -mrelocation-model static -mdisable-fp-elim
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.20.51 -momit-leaf-frame-pointer -resource-dir
/home/mburke/src/build/Release+Asserts/bin/../lib/clang/3.0 -ferror-limit 19
-fmessage-length 120 -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o test.o -x c test.c 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'test.c'.
4.    Running pass 'X86 DAG->DAG Instruction Selection' on function
'@AtomicFetch'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)


Compiler version:

mburke at D1018130-linux:~/src/tmp$ ../build/Release+Asserts/bin/clang -v
clang version 3.0 (trunk 129282)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list