[PATCH] D75326: [entry values] X86: Describe effects of MOV{8,16}ri (PR45053)

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 02:07:16 PST 2020


dstenb added a comment.

In D75326#1898465 <https://reviews.llvm.org/D75326#1898465>, @vsk wrote:

> In D75326#1898169 <https://reviews.llvm.org/D75326#1898169>, @dstenb wrote:
>
> > In D75326#1898071 <https://reviews.llvm.org/D75326#1898071>, @vsk wrote:
> >
> > > Thank you @dstenb and @djtodoro very much for your feedback.
> > >
> > > I think I've addressed the main issue, we now produce `DW_AT_call_value (DW_OP_constu 0x840, DW_OP_stack_value, DW_OP_piece 0x2)`. PTAL.
> >
> >
> > I might be incorrect here, but I don't think we are allowed to use DW_OP_piece operations in DW_AT_call_value attributes, as they should be DWARF expressions? As far as I have understood it, the DW_OP_piece operation is only allowed in composite location descriptions, and you can in general not go from location descriptions to DWARF expressions, with the only (?) exception being DW_OP_entry_value operations holding register location descriptions.
> >
> > (This seems a bit related to D75270 <https://reviews.llvm.org/D75270>, in which I stop emitting entry values around composite location descriptions, since the DWARF standard specifies that those are only allowed to hold DWARF expressions and register location descriptions.)
>
>
> If I understand your reading correctly, it's that composite location descriptions are not (in general) a kind of DWARF expression.
>
> FWIW, this doesn't line up with my understanding. DWARF5 says "a single location description" may be "a composite location description", which consists of "one or more simple location descriptions", each of which describes "one piece of the object" (2.6.1). And it says that a DWARF expression describes "how to compute a value or specify a location" (2.5). That certainly /sounds/ like a composite location can be a DWARF expression.


Section 2.5 also specifies the following for DWARF expressions: //"They are expressed in terms of DWARF operations that operate on a stack of values."//. Section 2.6.1.2 specifies //"A composite location description describes an object or value which may be contained in part of a register or stored in more than one location. Each piece is described by a composition operation, which does not compute a value nor store any result on the DWARF stack."//. I think that those two things speak against composite location description being DWARF expressions.

Section 2.6 specifies the following for single location descriptions: //"are a language independent representation of addressing rules of arbitrary complexity built from DWARF expressions (See Section 2.5 on page 26) and/or other DWARF operations specific to describing locations."//. There they make a distinction between DWARF expressions, and the "DWARF opertions specific to describing locations", which I assume are the operations listed in 2.6, which include `DW_OP_piece`.

It would be good to get a clarification on dwarf-discuss, as @aprantl suggests. Does anyone want to put together a mail? Otherwise I can volunteer.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75326/new/

https://reviews.llvm.org/D75326





More information about the llvm-commits mailing list