Hi Jakub, Thanks for clarifying this. I went through literature and other stuff available, it describes operation and semantics. Unfortunately I wasn't able to get to the actual DWARF Issue/proposal when it was proposed.
One small doubt still remains. It seems(to me) that DW_OP_stack_value and DW_OP_implicit_value both can be used to describe most optimized location/value of a variable. Then representing/choosing appropriate operation involves matter like space/compactness(just like GCC does) or maybe other factors too ? I'm unable to come-up with an motivating example where DW_OP_implicit_value is indispensable. Would you please, if possible, share an example(test case or any specific situation) covering this. Thanks a lot again! Sourabh. -----Original Message----- From: Jakub Jelinek <ja...@redhat.com> Sent: Saturday, July 4, 2020 10:33 PM To: Tomar, Sourabh Singh <sourabhsingh.to...@amd.com> Cc: gcc@gcc.gnu.org Subject: Re: DW_OP_implict_value usage and motivation [CAUTION: External Email] On Sat, Jul 04, 2020 at 04:23:58PM +0000, Tomar, Sourabh Singh wrote: > Consider the following test case: > [..] > int main () { > __int128 newVar = 8; > newVar = ~newVar; > return 0; > } DW_OP_implicit_value as well as DW_OP_stack_value is described in DWARF4/5, just read the description in there. And as you found, in some cases it is possible to represent the value by either of those, in which case GCC tries to use the shorter one. For __int128, to use DW_OP_stack_value one would need to use the typed DWARF stack DWARF5 features (so e.g. inappropriate in DWARF4 mode when it can be represented by DWARF4 features already). Jakub