This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rtlopt] Location list data


Daniel Jacobowitz <drow at mvista dot com> writes:

> We've got a global variable 'j'.  On i386 with -O2, it gets loaded into a
> register.  The location list looks like this:
> 
>     00000013 00000021 00000027 (DW_OP_addr: 80493b8; )
>     00000013 00000027 0000002a (DW_OP_reg2; )
>     00000013 0000002a 00000032 (DW_OP_addr: 80493b8; )

This is not quite right.  There are two uses for this data:

1. 'print j'.  In that case, you could just claim that it's always in
   the global address, and that would work fine.

2. 'j = 3'.  For that, you have to explain that the variable is in
   *both* places, because both will need to be updated.  You certainly
   wouldn't want to be just changing the register, since that'll go away.

I think you really want to say is (and have no idea if this is legal
DWARF2, or for that matter if GCC can do this):

     00000013 00000000 ffffffff (DW_OP_addr: 80493b8; )
     00000013 00000027 0000002a (DW_OP_reg2; )
     00000013 00000032 0000003a (DW_OP_reg2; )

-- 
- Geoffrey Keating <geoffk at geoffk dot org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]