This is the mail archive of the
mailing list for the GCC project.
Re: Query with legitimate_constant_p
- From: Geoff Keating <geoffk at geoffk dot org>
- To: "Daniel Towner" <dant at picochip dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 11 Feb 2002 10:29:57 -0800
- Subject: Re: Query with legitimate_constant_p
- References: <003001c1b26b$b3cbd790$1528fdd5@DERWENT>
"Daniel Towner" <firstname.lastname@example.org> writes:
> Hi all,
> I am writing a new port of GCC. I want to prevent symbol_refs from being
> used as immediate operands, so I am specifically rejecting these in
You don't want to do this...
> However, this also means that the addresses of
> symbol_refs can't be computed (e.g, loading the address into a register),
because clearly you _do_ use SYMBOL_REF as an immediate operand.
> where previously a `mov??3' instruction was used to move the symbol_ref
> address into a register. This no longer works, as the mov instruction can't
> accept an immediate symbol_ref any more. How do I fix this?
Instead of doing that, use `n' constraints, and suitable predicates
where appropriate, to prevent GCC generating symbol references as
immediate operands where they won't work.
> Do I need an instruction pattern which just matches a symbol_ref and
> loads its value into a register, or do I need to use a define_expand
> to explicitly create such an instruction?
- Geoffrey Keating <email@example.com> <firstname.lastname@example.org>