[LLVMbugs] [Bug 10394] New: Assertion failed compiling while loop with continue in the guard

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 18 11:20:21 PDT 2011


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

           Summary: Assertion failed compiling while loop with continue in
                    the guard
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bagnara at cs.unipr.it
                CC: llvmbugs at cs.uiuc.edu


$ cat q.c
int main() {
  do {
    while (({ continue; 1; })) {
      return 1;
    }
  } while (0);
  return 0;
}
$ clang q.c
clang: /home/roberto/deps/build/llvm-r135343/lib/VMCore/Value.cpp:285: void
llvm::Value::replaceAllUsesWith(llvm::Value*): Assertion `New != this &&
"this->replaceAllUsesWith(this) is NOT valid!"' failed.
0  libLLVM-3.0svn.so 0x00007fb094e96f59
1  libLLVM-3.0svn.so 0x00007fb094e96d55
2  libc.so.6         0x00007fb092cc8d80
3  libc.so.6         0x00007fb092cc8d05 gsignal + 53
4  libc.so.6         0x00007fb092cccab6 abort + 390
5  libc.so.6         0x00007fb092cc17c5 __assert_fail + 245
6  libLLVM-3.0svn.so 0x00007fb094a8789c
llvm::Value::replaceAllUsesWith(llvm::Value*) + 98
7  clang             0x0000000000d56642
clang::CodeGen::CodeGenFunction::SimplifyForwardingBlocks(llvm::BasicBlock*) +
150
8  clang             0x0000000000d574e7
clang::CodeGen::CodeGenFunction::EmitWhileStmt(clang::WhileStmt const&) + 1011
9  clang             0x0000000000d55ef2
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 638
10 clang             0x0000000000d563fa
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 306
11 clang             0x0000000000d561b3
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 217
12 clang             0x0000000000d55cbf
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 75
13 clang             0x0000000000d5766b
clang::CodeGen::CodeGenFunction::EmitDoStmt(clang::DoStmt const&) + 371
14 clang             0x0000000000d55f15
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 673
15 clang             0x0000000000d563fa
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 306
16 clang             0x0000000000d561b3
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 217
17 clang             0x0000000000d55cbf
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 75
18 clang             0x0000000000d876fc
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&)
+ 154
19 clang             0x0000000000d87aaa
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 664
20 clang             0x0000000000c40327
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 917
21 clang             0x0000000000c3e0a5
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 503
22 clang             0x0000000000c3dd19
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 773
23 clang             0x0000000000c42ae8
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 310
24 clang             0x0000000000c36f73
25 clang             0x0000000000c36386
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 158
26 clang             0x0000000000da831f clang::ParseAST(clang::Sema&, bool) +
436
27 clang             0x0000000000aef6d3
clang::ASTFrontendAction::ExecuteAction() + 263
28 clang             0x0000000000c359df clang::CodeGenAction::ExecuteAction() +
957
29 clang             0x0000000000aef32f clang::FrontendAction::Execute() + 325
30 clang             0x0000000000ad51c3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 741
31 clang             0x0000000000aa9f88
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 909
32 clang             0x0000000000a9b29f cc1_main(char const**, char const**,
char const*, void*) + 983
33 clang             0x0000000000aa5600 main + 496
34 libc.so.6         0x00007fb092cb3eff __libc_start_main + 255
35 clang             0x0000000000a9a949
Stack dump:
0.    Program arguments: /home/roberto/deps/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
q.c -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.21.0.20110327 -momit-leaf-frame-pointer -resource-dir
/home/roberto/deps/bin/../lib/clang/3.0 -ferror-limit 19 -fmessage-length 80
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-M7P3ut.o -x c q.c 
1.    <eof> parser at end of file
2.    q.c:1:5: LLVM IR generation of declaration 'main'
3.    q.c:1:5: Generating code for declaration 'main'
4.    q.c:1:12: LLVM IR generation of compound statement ('{}')
5.    q.c:2:6: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 2 (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