public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: eashan gupta <gupta.eashan@gmail.com>, gcc-help@gcc.gnu.org
Subject: Re: Access RTX register information
Date: Tue, 05 May 2020 17:06:12 -0600	[thread overview]
Message-ID: <786dd932f06faa247e7fd3717e2d0ee39fc23581.camel@redhat.com> (raw)
In-Reply-To: <CAJT-Qf9hdz+LSkpTum3MqN2u3zkkgsmnUKd3YK4aMw_t5wHQeQ@mail.gmail.com>

On Wed, 2020-05-06 at 04:27 +0530, eashan gupta via Gcc-help wrote:
> Hi,
> Is it possible to access the variable name if we have an RTX which is a reg
> that corresponds to a variable declared by the user?
> 
> I have found the macro REG_USERVAR_P (RTX) in rtl.h which returns the
> boolean "1 if RTX is a reg that corresponds to a variable declared by the
> user." But I am unable to get a suitable macro to get the variable name the
> reg corresponds to.
> 
> On dumping the rtl output using the command:
> 
> print_rtl_single(stdout, in_rtx);
> 
> I get output:
> 
> (reg/v:SI 68 [ c ])
> 
> where "c" was the variable name defined by me. How do I access "c" given
> the rtx statement, "in_rtx"?
If/when this information is available it would be in the REG_EXPR field which
would point back to the tree declaration.

jeff


  reply	other threads:[~2020-05-05 23:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 22:57 eashan gupta
2020-05-05 23:06 ` Jeff Law [this message]
2020-05-05 23:42   ` eashan gupta
2020-05-06 17:35     ` Jeff Law
2020-05-07 12:51       ` eashan gupta

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=786dd932f06faa247e7fd3717e2d0ee39fc23581.camel@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gupta.eashan@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).