[LLVMbugs] [Bug 10426] New: ICE with inline asm

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 20 07:08:48 PDT 2011


           Summary: ICE with inline asm
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: mattiase at acm.org
                CC: llvmbugs at cs.uiuc.edu

clang version 3.0 (trunk 135473)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Compiling the test case below with: clang -O2 -g -m32 -c testcase.c
causes the following assertion failure:

clang: /home/mattias/src/llvm/lib/MC/MCStreamer.cpp:81: virtual void
llvm::MCStreamer::EmitIntValue(uint64_t, unsigned int, unsigned int): Assertion
`(isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) && "Invalid size"'
0  clang           0x0000000001b2118f
1  clang           0x0000000001b23116
2  libpthread.so.0 0x000000311ac0eb10
3  libc.so.6       0x000000311a030265 gsignal + 53
4  libc.so.6       0x000000311a031d10 abort + 272
5  libc.so.6       0x000000311a0296e6 __assert_fail + 246
6  clang           0x0000000001acccb7 llvm::MCStreamer::EmitIntValue(unsigned
long, unsigned int, unsigned int) + 247
7  clang           0x000000000162d8cd
llvm::DIEBlock::EmitValue(llvm::AsmPrinter*, unsigned int) const + 221
8  clang           0x000000000160e96b llvm::DwarfDebug::emitDIE(llvm::DIE*) +

typedef unsigned long long uint64;

void ct(uint64 a, uint64 b);

static uint64 swab64(uint64 x)
        __asm__ ("xchg %%edx,%%eax\n"
                 "bswap %%edx\n"
                 "bswap %%eax\n" : "=A" (x) : "0" (x));
        return x;

static uint64 f(const uint64 *p) { return swab64(*p); }

void g(void)
        uint64 a = 0xabcdef0912345678ull;
        ct(f(&a), 0x7856341209efcdabull);

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