[LLVMbugs] [Bug 21232] New: Assertion in CGClass.cpp: Bad field	alignment
    bugzilla-daemon at llvm.org 
    bugzilla-daemon at llvm.org
       
    Thu Oct  9 17:07:37 PDT 2014
    
    
  
http://llvm.org/bugs/show_bug.cgi?id=21232
            Bug ID: 21232
           Summary: Assertion in CGClass.cpp: Bad field alignment
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: warren_ristow at playstation.sony.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified
The following volatile bitfield test-case:
// ================ test.cpp ================
struct BB {
  virtual void d();
  volatile char e : 8;
  char f : 1;
  char g;
};
BB i() {
  static BB j;
  return j;
}
// ==========================================
hits an assertion-failure:
$ clang++ --version
clang version 3.6.0 (trunk 219414)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang++ -c -O0 test.cpp
clang: .../llvm/tools/clang/lib/CodeGen/CGClass.cpp:831:
  void {anonymous}::FieldMemcpyizer::emitMemcpy(): Assertion
  `(CGF.getContext().toCharUnitsFromBits(FirstFieldOffset) % Alignment) == 0
          && "Bad field alignment."' failed.
   .
   .
   .
$
In experiments, significantly older versions (Clang 3.2 based) compiled it
without error.
The problem was found on an x86_64 target, but also tested with '-target ppu',
and it failed the same way.
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141010/dc0c2f49/attachment.html>
    
    
More information about the llvm-bugs
mailing list