[LLVMbugs] [Bug 10040] New: Assertion `0 && "Invalid for compares"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 27 14:08:15 PDT 2011


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

           Summary: Assertion `0 && "Invalid for compares"' 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 ~]$ clang -v
clang version 3.0 (trunk 132199)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at gamow ~]$ clang -O2 small.c -c
clang: ConstantFolding.cpp:832: llvm::Constant*
llvm::ConstantFoldInstOperands(unsigned int, const llvm::Type*, llvm::Constant*
const*, unsigned int, const llvm::TargetData*): Assertion `0 && "Invalid for
compares"' failed.
0  clang           0x000000000190320f
1  clang           0x0000000001905482
2  libpthread.so.0 0x00007ffff7bcf8f0
3  libc.so.6       0x00007ffff6ebea75 gsignal + 53
4  libc.so.6       0x00007ffff6ec25c0 abort + 384
5  libc.so.6       0x00007ffff6eb7941 __assert_fail + 241
6  clang           0x00000000016fc1ff llvm::ConstantFoldInstOperands(unsigned
int, llvm::Type const*, llvm::Constant* const*, unsigned int, llvm::TargetData
const*) + 591
7  clang           0x0000000001684299
8  clang           0x0000000001685621
9  clang           0x0000000001685bfa
10 clang           0x0000000001641f81
11 clang           0x00000000016432ce
12 clang           0x000000000184d1bb
llvm::FPPassManager::runOnFunction(llvm::Function&) + 587
13 clang           0x00000000016e661d
14 clang           0x000000000184e897
llvm::MPPassManager::runOnModule(llvm::Module&) + 503
15 clang           0x000000000184ea2b llvm::PassManagerImpl::run(llvm::Module&)
+ 187
16 clang           0x00000000007cbda8
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 1720
17 clang           0x00000000007c93db
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 251
18 clang           0x00000000008fb37d clang::ParseAST(clang::Sema&, bool) + 413
19 clang           0x00000000007c86a4 clang::CodeGenAction::ExecuteAction() +
68
20 clang           0x00000000006b0e33
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 371
21 clang           0x000000000068b2c4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1268
22 clang           0x0000000000681948 cc1_main(char const**, char const**, char
const*, void*) + 760
23 clang           0x000000000068a180 main + 7040
24 libc.so.6       0x00007ffff6ea9c4d __libc_start_main + 253
25 clang           0x000000000067fd79
Stack dump:
0.    Program arguments:
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r132199-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.1 -momit-leaf-frame-pointer -coverage-file small.o -resource-dir
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r132199-install/bin/../lib/clang/3.0
-O2 -ferror-limit 19 -fmessage-length 80 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o small.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 'Combine redundant instructions' on function '@func_13'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)
[regehr at gamow ~]$ cat small.c
int g_3;
int *g_59;
static char g_245;
int *g_563;

static void func_21 (short p_22)
{
  int *l_640 = &g_3;
  if (*g_59)
    for (;; g_245 = 1);
  for (;;)
    {
      *l_640 = p_22 < 1 && (p_22 || g_245);
      *g_563 = 1;
    }
}

int *func_13 (int **p_14, int *p_15)
{
  short l_20[1];
  int i;
  for (i = 0; i < 1; i++)
    l_20[i] = 0;
  func_21 (l_20[0]);
  return 0;
}

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