[LLVMbugs] [Bug 9609] New: Assertion `(Op1C->isZero() || Op1C->getValue() == KnownZeroMask) && "Constant icmp not folded?"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Apr 2 09:52:25 PDT 2011


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

           Summary: Assertion `(Op1C->isZero() || Op1C->getValue() ==
                    KnownZeroMask) && "Constant icmp not folded?"' failed.
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: All
            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 tmp008]$ clang -w -O2 -c small.c
clang: InstCombineCasts.cpp:917: llvm::Instruction*
llvm::InstCombiner::transformSExtICmp(llvm::ICmpInst*, llvm::Instruction&):
Assertion `(Op1C->isZero() || Op1C->getValue() == KnownZeroMask) && "Constant
icmp not folded?"' failed.
0  clang           0x000000000188768f
1  clang           0x0000000001889902
2  libpthread.so.0 0x00007fd29bc85190
3  libc.so.6       0x00007fd29af8a4b5 gsignal + 53
4  libc.so.6       0x00007fd29af8df50 abort + 384
5  libc.so.6       0x00007fd29af83481 __assert_fail + 241
6  clang           0x00000000015f3717
7  clang           0x00000000015f390e
8  clang           0x00000000015d1fb4
9  clang           0x00000000015d284f
10 clang           0x00000000017ce04b
llvm::FPPassManager::runOnFunction(llvm::Function&) + 587
11 clang           0x000000000166d58b
12 clang           0x000000000166e935
13 clang           0x00000000017cf654
llvm::MPPassManager::runOnModule(llvm::Module&) + 500
14 clang           0x00000000017cf88b llvm::PassManagerImpl::run(llvm::Module&)
+ 187
15 clang           0x0000000000817cd9
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 1625
16 clang           0x0000000000814aab
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 251
17 clang           0x000000000093bd0f clang::ParseAST(clang::Sema&, bool) + 431
18 clang           0x0000000000814244 clang::CodeGenAction::ExecuteAction() +
68
19 clang           0x00000000007088b3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 371
20 clang           0x00000000006e2352
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1298
21 clang           0x00000000006d92cc cc1_main(char const**, char const**, char
const*, void*) + 524
22 clang           0x00000000006e143d main + 4445
23 libc.so.6       0x00007fd29af75abd __libc_start_main + 253
24 clang           0x00000000006d7a19
Stack dump:
0.    Program arguments:
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r128769-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-r128769-install/bin/../lib/clang/3.0
-O2 -w -ferror-limit 19 -fmessage-length 83 -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 '@int64func'
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 tmp008]$ clang -v
clang version 3.0 (trunk 128769)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at gamow tmp008]$ cat small.c
typedef char int8_t;
typedef int int16_t;
typedef int int32_t;
typedef char uint8_t;
typedef int uint16_t;
typedef int uint64_t;
uint8_t
safe_lshift_func_int8_t_s_u (int8_t left, int right)
{
  return left || right || left >> right ? : left << right;
}

uint8_t
safe_mul_func_int16_t_s_s (int16_t si1, uint8_t si2)
{
  return si1 * si2;
}

uint8_t
safe_add_func_int32_t_s_s (int32_t si1, uint8_t si2)
{
  return si1 && si2 && si1 > -si2 || si1 && si2 && si1 < -si2 ? : si1 + si2;
}

uint8_t g_3[1] = {
  0
};

uint8_t g_6;
uint8_t g_14;
uint8_t g_16;
uint8_t g_52[9] = {
  0
};

uint8_t *g_68[8] = {
  0
};

uint8_t *g = &g_14;
uint16_t func_22 (int32_t * const *p_23);
int16_t func_69 (uint64_t p_70, uint8_t p_71, int16_t ** p_72);
int64func (uint32p_10)
{
  uint8_t *l_13[5][3][1];
  uint8_t l_698[1][8][3] = {
  };
  if (func_22 (&g_68[7]))
    g_52[4] ^ l_698[0][3][1], func_69 (g_14, g_16, &l_13[3][2][0]);
  return g_3[0];
}

uint16_t
func_22 (int32_t * const *p_23)
{
  uint16_t l_24[4][4][5] = {
  };
lbl_545:for (g_14 = 0; 1; g += 1)
    return l_24[+4][+4][+5];
}

int16_t
func_69 (uint64_t p_70, uint8_t p_71, int16_t ** p_72)
{
  uint8_t l_75 = 0x10L;
  uint8_t *l_76 = &g_6;
  l_75 &= p_71;
  *l_76 &= l_75;
  *l_76 =
    safe_mul_func_int16_t_s_s ((g_52[7]
                && safe_lshift_func_int8_t_s_u (p_70,
                                0)) | *l_76 !=
                   1, safe_add_func_int32_t_s_s);
  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