Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Jeff Law <law@redhat.com>, gcc-patches@gcc.gnu.org
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: Generate normal DWARF DW_LOC descriptors for non integer mode pointers
Date: Tue, 17 May 2016 12:37:00 -0000	[thread overview]
Message-ID: <344916c2-c8d0-9a4b-1fc4-0b8035276ea6@redhat.com> (raw)
In-Reply-To: <1c7da1c8-c088-6c35-dbc8-bacebd4ad4d0@redhat.com>

Hi Jeff,

>>   Currently dwarf2out.c:mem_loc_descriptor() has some special case
>>   code to handle the situation where an address is held in a register
>>   whose mode is not of type MODE_INT.  It generates a
>>   DW_OP_GNU_regval_type expression which may later on be converted into
>>   a frame pointer based expression.  This is a problem for targets which
>>   use a partial integer mode for their pointers (eg the msp430).  In
>>   such cases the conversion to a frame pointer based expression could
>>   be wrong if the frame pointer is not being used.

> I may be missing something, but isn't it the transition to an FP 
> relative address rather than a SP relative address that's the problem 
> here?

Yes, I believe so.

> Where does that happen?  

I did not track it down.  But whilst I was searching for the cause I came
across the code that is modified by the patch.  Reading the code it seemed
obvious to me that the special case for handling non INT_MODE register modes
was not intended for pointers, and when I tried out a small patch it worked.

> Is it possible we've got the wrong DECL_RTL or somesuch?

I don't think so.  I am not familiar with this code myself, but the dump from 
the dwarf2 pass shows:

  (insn 5 2 6 (set (mem/c:HI (plus:PSI (reg/f:PSI 1 R1)
                (const_int 4 [0x4])) [1 c+0 S2 A16])
        (const_int 5 [0x5])) /work/sources/binutils/current/gdb/testsuite/gdb.base/advance.c:41 12 {movhi}
     (nil))

which to me pretty clearly shows that "c" is being stored at R1+4.

Cheers
  Nick


  reply	other threads:[~2016-05-17 12:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16 14:12 Nick Clifton
2016-05-16 20:08 ` Jeff Law
2016-05-17 12:37   ` Nick Clifton [this message]
     [not found]     ` <9f8e1f36-5186-67bc-898e-6910e0d041a6@redhat.com>
2016-05-26 16:16       ` Nick Clifton
2016-06-21 22:09         ` Jeff Law
2016-06-22 15:13           ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=344916c2-c8d0-9a4b-1fc4-0b8035276ea6@redhat.com \
    --to=nickc@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=law@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox