<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 - [DebugInfo] Overlapping fragment crash at -g -O3 -mllvm -enable-partial-inlining"
   href="https://bugs.llvm.org/show_bug.cgi?id=48311">48311</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[DebugInfo] Overlapping fragment crash at -g -O3 -mllvm -enable-partial-inlining
          </td>
        </tr>

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

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

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>DebugInfo
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sourav0311@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>aprantl@apple.com, jdevlieghere@apple.com, jeremy.morse.llvm@gmail.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com, vsk@apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ clang -g -O3 -mllvm -enable-partial-inlining test.c

      ~~~~^~~~~~~~~~~ 
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:638: void
llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*): Assertion
`FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"'
failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /home/sourabh/mirror-1.      <eof> parser at end of
file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'test.c'.
4.      Running pass 'X86 Assembly Printer' on function '@k.1.if.then'
...

Reduced test case:
int i();
int m();
int l();
int n(int, int*);

struct a {
  struct {
    long b;
    int volatile c;
  } d;
};
long e;
int j;
int f() {
  volatile int g;
  do {
    if (g)
      return 0;
    struct a h;
    h.d.c = e = i();
  } while (1);
}
void k() {
  if (l()) {
    int c = f();
    while (0 == c) {
      m();
      f() <= n(j, &c);
    }
  }
}
void p() { k(); }

For simplifying reproducibity, can also be reproduced as:
$ clang -g -O3 test.c -S -emit-llvm
$ opt -partial-inliner test.ll -S | llc >/dev/null
--CRASH--</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>