[LLVMbugs] [Bug 9223] New: Assertion `isReg() && "This is not a register operand!"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 14 18:26:34 PST 2011


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

           Summary: Assertion `isReg() && "This is not a register
                    operand!"' 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


[regehr at gamow tmp003]$ clang -O2 small.c
small.c:10:14: warning: '&&' within '||' [-Wlogical-op-parentheses]
  return si2 || si1 && si2 ? si1 : (si1 % si2);
             ^  ~~~~~~~~~~
small.c:10:14: note: place parentheses around the '&&' expression to silence
      this warning
  return si2 || si1 && si2 ? si1 : (si1 % si2);
             ^
                (         )
clang:
/uusoc/exports/scratch/regehr/z/compiler-build/llvm-r125546/include/llvm/MC/MCInst.h:59:
unsigned int llvm::MCOperand::getReg() const: Assertion `isReg() && "This is
not a register operand!"' failed.
0  clang           0x00000000017ffe6f
1  clang           0x00000000018020e2
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           0x00000000011cae74
7  clang           0x00000000011cdc56
8  clang           0x00000000017a3e63
9  clang           0x00000000017b0048
llvm::MCObjectStreamer::EmitInstruction(llvm::MCInst const&) + 376
10 clang           0x0000000001136173
11 clang           0x0000000001345498 llvm::AsmPrinter::EmitFunctionBody() +
264
12 clang           0x000000000112e8ad
13 clang           0x0000000001748a1d
llvm::FPPassManager::runOnFunction(llvm::Function&) + 557
14 clang           0x0000000001748b1b
llvm::FPPassManager::runOnModule(llvm::Module&) + 75
15 clang           0x000000000174a244
llvm::MPPassManager::runOnModule(llvm::Module&) + 500
16 clang           0x000000000174a3b7 llvm::PassManagerImpl::run(llvm::Module&)
+ 167
17 clang           0x0000000000814d68
clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&,
clang::TargetOptions const&, llvm::Module*, clang::BackendAction,
llvm::raw_ostream*) + 1720
18 clang           0x0000000000811fcb
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 251
19 clang           0x000000000092d833 clang::ParseAST(clang::Sema&, bool) + 291
20 clang           0x0000000000811744 clang::CodeGenAction::ExecuteAction() +
68
21 clang           0x00000000006f7625
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 357
22 clang           0x00000000006d275c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1276
23 clang           0x00000000006c9eab cc1_main(char const**, char const**, char
const*, void*) + 539
24 clang           0x00000000006d189d main + 4685
25 libc.so.6       0x00007ffff6ec2abd __libc_start_main + 253
26 clang           0x00000000006c85d9
Stack dump:
0.    Program arguments:
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r125546-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-r125546-install/bin/../lib/clang/2.9
-O2 -ferror-limit 19 -fmessage-length 80 -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-d2qNAa.o -x c small.c 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'small.c'.
4.    Running pass 'X86 AT&T-Style Assembly Printer' on function '@int322'
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 tmp003]$ clang -v

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

[regehr at gamow tmp003]$ cat small.c


static int
foo (long si1, int si2)
{
  return si1 ^ si2 & si1 ^ si1 ^ si2 & ~0 - si2 ^ si2 < 0 ? : si1 - si2;
}

static int
bar (long si1, int si2)
{
  return si2 || si1 && si2 ? si1 : (si1 % si2);
}

static unsigned char
baz (unsigned char ui1, unsigned char ui2)
{
  return ui2 == 0 ? : (ui1 % ui2);
}

int g_29;

void int322 (int8p_83)
{
  unsigned long l_88 = 0xBAE6652566A56D10LL;
  int *l_96 = &g_29;
  *l_96 =
    bar (1 > 1,
     1) >=
    baz (foo
     (l_88, bar (l_88, +g_29)
      || l_88 ^ l_88), -2L);
}

int
main (void)
{
  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