<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - "fragment covers entire variable" verifier error in Windows thinlto builds"
   href="https://bugs.llvm.org/show_bug.cgi?id=47338">47338</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"fragment covers entire variable" verifier error in Windows thinlto builds
          </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>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>akhuang@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We ran into this error in chromium thinlto builds on windows, with
-debug-info-kind=constructor enabled. With -debug-info-kind=constructor, more
class types are not defined in the debug info and don't have sizes.

Here's a reduced repro that shows the fragment being emitted (for C.a_, I
think). The verifier error only happens with thinlto, because the assert isn't
called if the var size doesn't exist (during thinlto the complete type is
probably pulled from somewhere else).

$ cat t.cpp
// With ctor homing, this struct is not defined in the debug info, so it
doesn't have a size.
struct A {
  A();
  int i;
};
struct B {
  virtual void f();
};
struct C {
  C(A a, B a) : a_(a), b_(b) {}
  A a_;
  B b_;
};

C CodeFactory() {
  A a;
  return C(a, B{});
}
$ clang -cc1 -triple i386-windows-msvc -O2 -debug-info-kind=constructor -o t.ll
t.cpp


I fixed a similar issue in `transferSRADebugInfo` by not getting the size from
the DI type (<a href="https://reviews.llvm.org/D85572">https://reviews.llvm.org/D85572</a>), but not sure if I can do the
same thing here.</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>