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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected],
                    [email protected], [email protected]

$ 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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to