From: Daniel Jacobowitz <drow@false.org>
To: Andreas Schwab <aschwab@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Don't overshoot when executing cfa instructions
Date: Mon, 29 Jun 2009 14:33:00 -0000 [thread overview]
Message-ID: <20090629143255.GA25594@caradoc.them.org> (raw)
In-Reply-To: <m3k52vtbxu.fsf@hase.home>
On Mon, Jun 29, 2009 at 03:19:09PM +0200, Andreas Schwab wrote:
> Daniel Jacobowitz <drow@false.org> writes:
>
> > Actually, before approving this I have a question. What about state
> > changes caused by the branch?
> >
> > I remember a similar problem with location lists. Before the branch,
> > a variable lives at some location. Inside the called function, it is
> > gone. Did we ever find a representation for that? Does it rely
> > on the instruction after the branch marking the register as clobbered?
>
> Do you have a testcase, or a hint how to create one?
We currently deal with this by implicit knowledge of the ABI
(dwarf2_init_reg methods). I couldn't coax either GCC or RealView
into producing an example, but here's what I was thinking of:
foo:
.cfi_startproc
mov sp, fp
.cfi_def_cfa_register fp
push r0
push r1
bl bar @ clobber r0, r1, r2
.cfi_offset r0, -4
.cfi_offset r1, -8
.cfi_undefined r2
pop r0, r1
.cfi_same_value r0
.cfi_same_value r1
ret
I think this CFI is unlikely, but correct. At "bl bar" r1 can be
found in r1. After that instruction it must be found on the stack.
GCC already combines pushes in this way although it will place the CFI
after the last push. But if it emitted full undefined markers,
isn't that where the r2 marker would have to go?
--
Daniel Jacobowitz
CodeSourcery
prev parent reply other threads:[~2009-06-29 14:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-27 22:23 Andreas Schwab
2009-06-27 22:28 ` Daniel Jacobowitz
2009-06-27 22:33 ` Daniel Jacobowitz
2009-06-29 13:19 ` Andreas Schwab
2009-06-29 14:33 ` Daniel Jacobowitz [this message]
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=20090629143255.GA25594@caradoc.them.org \
--to=drow@false.org \
--cc=aschwab@redhat.com \
--cc=gdb-patches@sourceware.org \
/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