[llvm] r257534 - [Utils] Insert DW_OP_bit_piece when only describing part of the variable

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 17 07:02:03 PST 2016


On Tue, Jan 12, 2016 at 10:46:09PM -0000, Keno Fischer via llvm-commits wrote:
> Author: kfischer
> Date: Tue Jan 12 16:46:09 2016
> New Revision: 257534
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=257534&view=rev
> Log:
> [Utils] Insert DW_OP_bit_piece when only describing part of the variable
> 
> Summary: The dbg.declare -> dbg.value conversion looks through any zext/sext
> to find a value to describe the variable (in the expectation that those
> zext/sext instruction will go away later). However, those values do not
> cover the entire variable and thus need a DW_OP_bit_piece.

This gives an assertion on the following test when compiling with -O2 -g:

    struct stat {
      int st_gid
    };
    typedef struct {
      char *path;
      struct stat attr
    } ctlfs_entry_t;
    mkstatnod(short p1) {
      ctlfs_entry_t c;
      memset(&c, 0, sizeof(ctlfs_entry_t));
      c.attr.st_gid = p1;
    }

--> llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1561: void
llvm::DebugLocEntry::finalize(const llvm::AsmPrinter &,
DebugLocStream::ListBuilder &, const llvm::DIBasicType *): Assertion
`Offset <= PieceOffset && "overlapping or duplicate pieces"' failed.

This is a regression for clang 3.8.

Joerg


More information about the llvm-commits mailing list