This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is there really only one symbol_ref object referring to each symbolic label?
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: 27 Jun 2003 13:59:30 -0700
- Subject: Re: Is there really only one symbol_ref object referring to each symbolic label?
- References: <20030627.161649.85392221.kazu@cs.umass.edu>
Kazu Hirata <kazu@cs.umass.edu> writes:
> Hi,
>
> GCC Internals Manual states that
>
> For any symbolic label, there is only one symbol_ref object
> referring to it.
>
> Does this mean x == y iff XSTR (x, 0) == XSTR (y, 0), assuming both x
> and y are SYMBOL_REF? If so, looking at gen_rtx_SYMBOL_REF, I think
> we can get two different rtx objects just by saying
>
> x = gen_rtx_SYMBOL_REF (Pmode, "hello");
> y = gen_rtx_SYMBOL_REF (Pmode, strdup ("hello"));
>
> Or are we not supposed to do this?
Strings in SYMBOL_REFs are supposed to live in the identifier hash
table, and so should be unique...
--
- Geoffrey Keating <geoffk@geoffk.org>