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

             Bug #: 52857
           Summary: [x32] DW_OP_GNU_regval_type doesn't handle
                    ARG_POINTER_REGNUM properly with -maddress-mode=long
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: hjl.to...@gmail.com
                CC: ubiz...@gmail.com


Created attachment 27081
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27081
A testcase

On Linux/x86-64, for the testcase, I got

# /xgcc -B./  -O -g /tmp/x.i -c -mx32 -maddress-mode=long
# readelf -w x.o
...
   <37a3>   DW_AT_GNU_call_site_value: 21 byte block: f5 ff ff ff ff f 25 f4 25
8 80 ff ff ff ff ff ff ff 22 f7 2c     (DW_OP_GNU_regval_type: 4294967295 (r-1)
<0x25>; DW_OP_GNU_const_type: <0x25>  8 byte block: 80 ff ff ff ff ff ff ff ;
DW_OP_plus; DW_OP_GNU_convert <0x2c>)

The problem is

         mem_loc_result = new_loc_descr (DW_OP_GNU_regval_type,
                                          dbx_reg_number (rtl), 0);

with

(gdb) call debug_rtx (rtl)
(reg/f:DI 16 argp)
(gdb) f 3
#3  0x0000000000709ec0 in mem_loc_descriptor (rtl=0x7ffff0e12978, mode=SImode, 
    mem_mode=VOIDmode, initialized=VAR_INIT_STATUS_INITIALIZED)
    at /export/gnu/import/git/gcc-addr32/gcc/dwarf2out.c:11631
11631          mem_loc_result = mem_loc_descriptor (SUBREG_REG (rtl),
(gdb) call debug_rtx (rtl)
(subreg:SI (plus:DI (reg/f:DI 16 argp)
        (const_int -128 [0xffffffffffffff80])) 0)
(gdb)

Reply via email to