[llvm-bugs] [Bug 48311] New: [DebugInfo] Overlapping fragment crash at -g -O3 -mllvm -enable-partial-inlining

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 26 21:34:37 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48311

            Bug ID: 48311
           Summary: [DebugInfo] Overlapping fragment crash at -g -O3
                    -mllvm -enable-partial-inlining
           Product: libraries
           Version: trunk
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: sourav0311 at gmail.com
                CC: aprantl at apple.com, jdevlieghere at apple.com,
                    jeremy.morse.llvm at gmail.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com, vsk at apple.com

$ 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 https://bugs.llvm.org/ 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--

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201127/fe1bccfa/attachment.html>


More information about the llvm-bugs mailing list