<html>
    <head>
      <base href="https://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 --- - Debug information for type is lost with LTO at -O0"
   href="https://llvm.org/bugs/show_bug.cgi?id=28149">28149</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Debug information for type is lost with LTO at -O0
          </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>Wolfgang_Pieb@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>// After r267296 the following simple example fails to retain debug 
// information for the type 'MyStruct' in the final executable when
// built with LTO. Building with -O2 behaves as expected.

// To build (on native Linux): 
// clang -std=c++11 -O0 -g -flto -c test.cpp 
// clang -flto -o test test.o

// 'llvm-dwarfdump test' shows no information for 'MyStruct'

__attribute__((noinline)) void use(int, int) { }

struct MyStruct {
    int w;
    int x;
    int y;
    int z;

    int foo();
    int bar();
};

int MyStruct::foo() {
    return 3;
}

int main() {
    MyStruct str{1, 2, 3, 4};
    use(str.x, str.y);
    return 0;
}</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>