If i compile the attached testcase for picochip under -O2, i get the following
location information for variable arg0 in main.

.ascii 16#61# 16#72# 16#67# 16#30# 16#0#   ; arg0\0
.initByte 0x1
.initByte 0x2a
.unalignedInitLong 0x9e
.initByte 0xc
.initByte 0x5b
.initByte 0x93
        .uleb128 0x2
.initByte 0x5b
.initByte 0x93
        .uleb128 0x2
.initByte 0x5b
.initByte 0x93
        .uleb128 0x2
.initByte 0x5b
.initByte 0x93
        .uleb128 0x2
        .uleb128 0xc
.unalignedInitLong _picoMark_Ldebug_ranges0+0xc
        .uleb128 0xa

which my dwarflib reader translates to mean

      <0x42f> (19) Lexical Block:
        Address Ranges: [0x18, 0x8d) [0x94, 0x99)
        <0x434> (20) Data:
          Name: arg0
          Type: <0xe0>
          Is External: false
          Location: DW_OP_reg11 DW_OP_piece: 2 DW_OP_reg11 DW_OP_piece: 2
DW_OP_reg11 DW_OP_piece: 2 DW_OP_reg11 DW_OP_piece: 2

R11 obviously does not contain all 4 piece os this 8-byte variable (a register
is 16-bit in picochip). I have tried to see if this was bug 43982, but the
mainline as of 20Jun with fix for that bug still reproduces this problem. 

The problem with this is that it doesn't actually say variable value is not
present, which is generally okay with -O2. It just gives wrong value silently!
Can you have a look at this, please?

I will attach the source file and the assembly. Please ask me if you need any
other information.


-- 
           Summary: VTA produces wrong variable location information
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hariharans at picochip dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: picochip-unknown-none


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44610

Reply via email to