This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: symbol_ref constants
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Sanjiv Kumar Gupta <skgnu at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 30 Mar 2005 14:01:29 +0100
- Subject: Re: symbol_ref constants
- Organization: Codesourcery LLC
- References: <20050330124333.28282.qmail@web50103.mail.yahoo.com>
Sanjiv Kumar Gupta wrote:
Thanks for a prompt reply, Nathan.
The add insn can take a symbol_ref, which is converted
to const_int during relocation. But I don't want to
allow expressions like (const:SI (plus:SI
symbol_ref:SI) (const_int)) in the insn.
How should I do that, do I need to implement
LEGITIMATE_CONST_P () accordingly?
you could do that, but I don't understand why symref+const
is not allowed. After all, you could have a different plain symref whose
value was the original symbol+const.
I.e. why is
add r1,foo+10
not allowed, but
add r1,baz
allowed. When linking baz could be defined as 'foo+10'. so what's going
on?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk