[LLVMbugs] [Bug 9112] New: Assertion `(KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 31 13:46:20 PST 2011


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

           Summary: Assertion `(KnownZero2 & KnownOne2) == 0 && "Bits
                    known to be one AND zero?"' 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 tmp446]$ clang -O2 -c small.c

clang: ValueTracking.cpp:410: void llvm::ComputeMaskedBits(llvm::Value*, const
llvm::APInt&, llvm::APInt&, llvm::APInt&, const llvm::TargetData*, unsigned
int): Assertion `(KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND
zero?"' failed.
0  clang           0x00000000017e44df
1  clang           0x00000000017e6752
2  libpthread.so.0 0x00007ffff7bd2190
3  libc.so.6       0x00007ffff6ed74b5 gsignal + 53
4  libc.so.6       0x00007ffff6edaf50 abort + 384
5  libc.so.6       0x00007ffff6ed0481 __assert_fail + 241
6  clang           0x0000000001674027 llvm::ComputeMaskedBits(llvm::Value*,
llvm::APInt const&, llvm::APInt&, llvm::APInt&, llvm::TargetData const*,
unsigned int) + 12199
7  clang           0x000000000167625e llvm::ComputeSignBit(llvm::Value*, bool&,
bool&, llvm::TargetData const*, unsigned int) + 622
8  clang           0x0000000001607158
9  clang           0x0000000001608d26
10 clang           0x0000000001607205
11 clang           0x0000000001608681
llvm::SimplifyInstruction(llvm::Instruction*, llvm::TargetData const*,
llvm::DominatorTree const*) + 1313
12 clang           0x00000000015ad7e1
llvm::SimplifyInstructionsInBlock(llvm::BasicBlock*, llvm::TargetData const*) +
193
13 clang           0x00000000014db7d5
14 clang           0x00000000014dd9b5
15 clang           0x00000000014de3bd
16 clang           0x000000000172dbad
llvm::FPPassManager::runOnFunction(llvm::Function&) + 557
17 clang           0x00000000015dbeab
18 clang           0x00000000015dc605
19 clang           0x000000000172f3d4
llvm::MPPassManager::runOnModule(llvm::Module&) + 500
20 clang           0x000000000172f547 llvm::PassManagerImpl::run(llvm::Module&)
+ 167
21 clang           0x00000000008136a9
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 1625
22 clang           0x0000000000810a1b
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 251
23 clang           0x000000000092c403 clang::ParseAST(clang::Sema&, bool) + 291
24 clang           0x0000000000810194 clang::CodeGenAction::ExecuteAction() +
68
25 clang           0x00000000006ff815
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 357
26 clang           0x00000000006d9c8c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1276
27 clang           0x00000000006d147b cc1_main(char const**, char const**, char
const*, void*) + 539
28 clang           0x00000000006d8dcd main + 4605
29 libc.so.6       0x00007ffff6ec2abd __libc_start_main + 253
30 clang           0x00000000006cfc59
Stack dump:
0.    Program arguments:
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r124573-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 -resource-dir
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r124573-install/bin/../lib/clang/2.9
-O2 -ferror-limit 19 -fmessage-length 99 -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 'Jump Threading' on function '@func'
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 tmp446]$ clang -v

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

[regehr at gamow tmp446]$ cat small.c


int safe (void);

static unsigned short
foo (unsigned short ui1, unsigned char ui2)
{
  return ui1 + ui2;
}

struct S0
{
  unsigned char f3;
  unsigned char f9;
};

struct S2
{
  short f5;
};

struct S0 g_4 = {
  0, 0
};

volatile struct S0 g_93 = {
  0, 0
};

unsigned char *g_211 = &g_4.f3;
unsigned char **g = &g_211;
struct S2 g_412 = {
  0
};

int
func_37 (void)
{
lbl_510:
  if (foo (0, 1)) goto lbl_510;
  return 0;
}

void
func (void)
{
  if (func_37 ())
    for (;; g_93.f9)
      for (g_412.f5 = 0; g_412.f5 < 0; g_412.f5 = foo (g_412.f5, 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