[LLVMbugs] [Bug 9420] New: Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 7 08:29:36 PST 2011


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

           Summary: Assertion `use_empty() && "Uses remain when a value is
                    destroyed!"' failed.
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu, chenyang at cs.utah.edu


[regehr at gamow tmp006]$ clang -v

clang version 2.9 (trunk 127161)
Target: x86_64-unknown-linux-gnu
Thread model: posix

[regehr at gamow tmp006]$ clang -O small.c -w

While deleting: i16 %p_34.addr.0
Use still stuck around after Def is destroyed:  %conv40 = trunc i16
%p_34.addr.0 to i8
clang: Value.cpp:76: virtual llvm::Value::~Value(): Assertion `use_empty() &&
"Uses remain when a value is destroyed!"' failed.
0  clang           0x000000000184a74f
1  clang           0x000000000184c9c2
2  libpthread.so.0 0x00007f3b2bf9b190
3  libc.so.6       0x00007f3b2b2a04b5 gsignal + 53
4  libc.so.6       0x00007f3b2b2a3f50 abort + 384
5  libc.so.6       0x00007f3b2b299481 __assert_fail + 241
6  clang           0x00000000017b06f3 llvm::Value::~Value() + 995
7  clang           0x0000000001766cf2 llvm::PHINode::~PHINode() + 66
8  clang           0x000000000162d15a
9  clang           0x0000000001634009
10 clang           0x0000000001634206 llvm::SimplifyCFG(llvm::BasicBlock*,
llvm::TargetData const*) + 22
11 clang           0x000000000158da3c
12 clang           0x000000000179887d
llvm::FPPassManager::runOnFunction(llvm::Function&) + 557
13 clang           0x000000000163d3db
14 clang           0x000000000163db35
15 clang           0x0000000001798414
llvm::MPPassManager::runOnModule(llvm::Module&) + 500
16 clang           0x0000000001798587 llvm::PassManagerImpl::run(llvm::Module&)
+ 167
17 clang           0x000000000080ad39
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 1625
18 clang           0x0000000000807e2b
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 251
19 clang           0x0000000000928f13 clang::ParseAST(clang::Sema&, bool) + 275
20 clang           0x00000000008075d4 clang::CodeGenAction::ExecuteAction() +
68
21 clang           0x0000000000700f1b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 347
22 clang           0x00000000006da622
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1298
23 clang           0x00000000006d1ca4 cc1_main(char const**, char const**, char
const*, void*) + 500
24 clang           0x00000000006d9715 main + 4837
25 libc.so.6       0x00007f3b2b28babd __libc_start_main + 253
26 clang           0x00000000006d04b9
Stack dump:
0.    Program arguments:
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r127161-install/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
small.c -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20 -momit-leaf-frame-pointer -resource-dir
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r127161-install/bin/../lib/clang/2.9
-O2 -w -ferror-limit 19 -fmessage-length 80 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-91IQD6.o -x c small.c 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module 'small.c'.
4.    Running pass 'Simplify the CFG' on function '@func_29'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

[regehr at gamow tmp006]$ cat small.c


static unsigned char
foo (char si1, unsigned char si2)
{
  return si1 + si2;
}

static unsigned char
bar (short si1, unsigned char si2)
{
  return si1 - si2;
}

static unsigned short
baz (unsigned short ui1, unsigned char ui2)
{
  return ui1 - ui2;
}

unsigned char g_8;
unsigned char *volatile g_13 = &g_8;
const unsigned char *g_41 = &g_8;
int func_46 (int p_47);
unsigned char *
func_29 (unsigned p_30, unsigned char * p_31, short p_32, unsigned char p_33,
     unsigned short p_34)
{
  for (0;; p_34 = foo (p_34, 0))
    {
      const unsigned char *l_39 = &g_8;
      for (p_32 = 1; p_32; p_32++)
    {
      const unsigned char **l_43 = &g_41;
      *l_43 = l_39;
      for (p_32 = 0;
           p_32 != 1; p_32 = baz (p_32, 1))
        if (func_46 (0) == &l_39 != &g_13)
          {
        unsigned char l_57[10];
        int i;
        for (i = 0; i < 1; i++)
          l_57[i];
          }
    }
      if (*l_39)
    break;
    }
  return 0;
}

int
func_46 (int32p_47)
{
  for (0;; 1)
    {
    }
}

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