[LLVMbugs] [Bug 11525] New: Segmentation fault on simple C99 source

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 9 09:34:00 PST 2011


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

             Bug #: 11525
           Summary: Segmentation fault on simple C99 source
           Product: clang
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: mike.bakhterev at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


When compiling simple source:

$ cat test.c 
typedef double eltype;

eltype matat(
        const eltype araw[],
        const unsigned m,
        const unsigned i,
        const unsigned j,
        const unsigned tc)
{
        return ((const eltype (*const)[m])araw)[i][j];
}

I get:
$ clang -v -flto -O4 test.c

clang version 2.9 (tags/RELEASE_29/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
 "/usr/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc
-disable-free -disable-llvm-verifier -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.21.1.20110627
-momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/2.9 -O3
-ferror-limit 19 -fmessage-length 0 -fgnu-runtime -fdiagnostics-show-option -o
/tmp/cc-I7y2Ut.o -x c test.c
clang -cc1 version 2.9 based upon llvm 2.9 hosted on x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/bin/../lib/clang/2.9/include
 /usr/include
End of search list.
0  libLLVM-2.9.so  0x00007f002f004a0f
1  libLLVM-2.9.so  0x00007f002f004fd1
2  libpthread.so.0 0x00007f002e959850
3  libLLVM-2.9.so  0x00007f002f1bddd0
4  libLLVM-2.9.so  0x00007f002f1c47b6
llvm::SimplifyInstruction(llvm::Instruction*, llvm::TargetData const*,
llvm::DominatorTree const*) + 342
5  libLLVM-2.9.so  0x00007f002ef26fed
6  libLLVM-2.9.so  0x00007f002ef2967d
7  libLLVM-2.9.so  0x00007f002f4f0e55
llvm::FPPassManager::runOnFunction(llvm::Function&) + 501
8  libLLVM-2.9.so  0x00007f002f4f0fb1
llvm::FunctionPassManagerImpl::run(llvm::Function&) + 97
9  libLLVM-2.9.so  0x00007f002f4f1091
llvm::FunctionPassManager::run(llvm::Function&) + 97
10 clang           0x0000000000613cce
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 3918
11 clang           0x0000000000611d0e
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 238
12 clang           0x000000000071ae2b clang::ParseAST(clang::Sema&, bool) + 251
13 clang           0x0000000000610c03 clang::CodeGenAction::ExecuteAction() +
51
14 clang           0x000000000054393b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 283
15 clang           0x000000000052987b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 971
16 clang           0x0000000000521d37 cc1_main(char const**, char const**, char
const*, void*) + 727
17 clang           0x00000000005208ba main + 634
18 libc.so.6       0x00007f002e0c317d __libc_start_main + 237
19 clang           0x0000000000521905
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-unknown-linux-gnu
-emit-llvm-bc -disable-free -disable-llvm-verifier -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.21.1.20110627
-momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/2.9 -O3
-ferror-limit 19 -fmessage-length 0 -fgnu-runtime -fdiagnostics-show-option -o
/tmp/cc-I7y2Ut.o -x c test.c 
1.    <eof> parser at end of file
2.    Per-function optimization
3.    Running pass 'Early CSE' on function '@matat'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

-- 
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