<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Assertion in CGClass.cpp: Bad field alignment"
   href="http://llvm.org/bugs/show_bug.cgi?id=21232">21232</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion in CGClass.cpp: Bad field alignment
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>warren_ristow@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>