From: Andrew Cagney <ac131313@cygnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] pseudo-register un-optimization
Date: Fri, 10 Aug 2001 16:52:00 -0000 [thread overview]
Message-ID: <3B7473C0.5020702@cygnus.com> (raw)
In-Reply-To: <3B7456F6.5596AE84@cygnus.com>
>
>
> 2001-08-10 Michael Snyder <msnyder@redhat.com>
>
> * regcache.c (legacy_write_register_gen): Don't 'optimize out'
> a write_register to a pseudo-reg. Target_store_pseudo_register
> needs to get called, because these regs may be computed and may
> have side-effects.
Michael, can you expand a little? This is legacy code, so as long as
this change is to keep an old target working, I'm not too fussed.
However, if this is for a new target then it should really be looking at
gdbarch_register_{read,write} and bypassing the legacy mess entirely.
Andrew
> Index: regcache.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/regcache.c,v
> retrieving revision 1.24
> diff -c -3 -p -r1.24 regcache.c
> *** regcache.c 2001/06/15 23:50:46 1.24
> --- regcache.c 2001/08/10 21:49:23
> *************** legacy_write_register_gen (int regnum, c
> *** 334,348 ****
>
> size = REGISTER_RAW_SIZE (regnum);
>
> - /* If we have a valid copy of the register, and new value == old value,
> - then don't bother doing the actual store. */
> -
> - if (register_cached (regnum)
> - && memcmp (register_buffer (regnum), myaddr, size) == 0)
> - return;
> -
> if (real_register (regnum))
> ! target_prepare_to_store ();
>
> memcpy (register_buffer (regnum), myaddr, size);
>
> --- 334,349 ----
>
> size = REGISTER_RAW_SIZE (regnum);
>
> if (real_register (regnum))
> ! {
> ! /* If we have a valid copy of the register, and new value == old
> ! value, then don't bother doing the actual store. */
> ! if (register_cached (regnum)
> ! && memcmp (register_buffer (regnum), myaddr, size) == 0)
> ! return;
> ! else
> ! target_prepare_to_store ();
> ! }
>
> memcpy (register_buffer (regnum), myaddr, size);
>
>
next prev parent reply other threads:[~2001-08-10 16:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-10 14:54 Michael Snyder
2001-08-10 16:52 ` Andrew Cagney [this message]
2001-08-13 11:23 ` Michael Snyder
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=3B7473C0.5020702@cygnus.com \
--to=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=msnyder@cygnus.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