<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 failed: (T == dwarf::DW_TAG_typedef || ...), function isUnsignedDIType, file lib/CodeGen/AsmPrinter/DwarfUnit.cpp, line 592"
   href="http://llvm.org/bugs/show_bug.cgi?id=22309">22309</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: (T == dwarf::DW_TAG_typedef || ...), function isUnsignedDIType, file lib/CodeGen/AsmPrinter/DwarfUnit.cpp, line 592
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.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>I encountered this assertion during compilation of a few FreeBSD kernel sources
with clang trunk r226904:

Assertion failed: (T == dwarf::DW_TAG_typedef || T == dwarf::DW_TAG_const_type
|| T == dwarf::DW_TAG_volatile_type || T == dwarf::DW_TAG_restrict_type || T ==
dwarf::DW_TAG_enumeration_type), function isUnsignedDIType, file
lib/CodeGen/AsmPrinter/DwarfUnit.cpp, line 592.

At that point, T has the value DW_TAG_union_type (0x17), so it looks like the
test at the start of isUnsignedDIType() does not consider union types to be
aggregate types:

    // (Pieces of) aggregate types that get hacked apart by SROA may also be
    // represented by a constant. Encode them as unsigned bytes.
    // FIXME: reference and rvalue_reference /probably/ shouldn't be allowed
    // here, but accept them for now due to a bug in SROA producing bogus
    // dbg.values.
    if (T == dwarf::DW_TAG_array_type ||
        T == dwarf::DW_TAG_class_type ||
        T == dwarf::DW_TAG_pointer_type ||
        T == dwarf::DW_TAG_ptr_to_member_type ||
        T == dwarf::DW_TAG_reference_type ||
        T == dwarf::DW_TAG_rvalue_reference_type ||
        T == dwarf::DW_TAG_structure_type)
      return true;

I'm not sure, but maybe DW_TAG_union_type should be added to this test.

Here is a reduced test case to show the problem:

============================================================
union mfi_evt {
  struct {
    int reserved;
  } members;
} mfi_aen_setup() {
  union mfi_evt a;
  a.members.reserved = 0;
}
============================================================

Compile with "clang -O1 -g -c" to get the assertion.</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>