[LLVMbugs] [Bug 3128] New: assertion with bitfields

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Nov 24 20:21:25 PST 2008


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

           Summary: assertion with bitfields
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: llvmbugs at cs.uiuc.edu


This comes from a randomly generated test produced by the 'quest' compiler
testing system:

  void foo(int x);
  struct hgt0
  {
    short int hg0;
    short int hg1[2];
    signed hg2:9;
  };
  void callee_hg0f (struct hgt0 hgp6)
  {
    foo(hgp6.hg2);
  }

$ llvm-gcc tescase.c
cc1: ../../src/gcc/llvm-convert.cpp:2330: llvm::Value*
TreeToLLVM::EmitLoadOfLValue(tree_node*, const MemRef*): Assertion
`ValSizeInBits > LV.BitStart && "Bad bitfield lvalue!"' failed.
23878.c: In function ‘callee_hg0f’:
23878.c:10: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

Here's the backtrace:

#0  0xffffe425 in __kernel_vsyscall ()
#1  0xf7c9a640 in raise () from /lib/i686/cmov/libc.so.6
#2  0xf7c9c018 in abort () from /lib/i686/cmov/libc.so.6
#3  0xf7c935be in __assert_fail () from /lib/i686/cmov/libc.so.6
#4  0x084cb441 in TreeToLLVM::EmitLoadOfLValue (this=0xff86f498, 
    exp=0xf79ff02c, DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:2330
#5  0x084bb21d in TreeToLLVM::Emit (this=0xff86f498, exp=0xf79ff02c, 
    DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:973
#6  0x084cf2d8 in TreeToLLVM::EmitMODIFY_EXPR (this=0xff86f498, 
    exp=0xf7977190, DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:2944
#7  0x084bb0e4 in TreeToLLVM::Emit (this=0xff86f498, exp=0xf7977190, 
    DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:979
#8  0x084d9d45 in TreeToLLVM::EmitFunction (this=0xff86f498)
    at ../../src/gcc/llvm-convert.cpp:909
#9  0x084a0da5 in llvm_emit_code_for_current_function (fndecl=0xf79f5a00)
    at ../../src/gcc/llvm-backend.cpp:734
#10 0x0810dc24 in tree_rest_of_compilation ()
(gdb) up 4
#4  0x084cb441 in TreeToLLVM::EmitLoadOfLValue (this=0xff86f498, 
    exp=0xf79ff02c, DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:2330
2330        assert(ValSizeInBits > LV.BitStart && "Bad bitfield lvalue!");
(gdb) p ValSizeInBits
$1 = 32
(gdb) p LV
$2 = {Ptr = 0x8f18194, BitStart = 0 '\0', BitSize = 0 '\0'}
(gdb) up
#5  0x084bb21d in TreeToLLVM::Emit (this=0xff86f498, exp=0xf79ff02c, 
    DestLoc=0x0) at ../../src/gcc/llvm-convert.cpp:973
973         Result = EmitLoadOfLValue(exp, DestLoc);
(gdb) p exp
$4 = (tree) 0xf79ff02c
(gdb) p DestLoc
$5 = (const MemRef *) 0x0


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