This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] delegitimize_address target call-back
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at www dot eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Kaveh Ghazi <ghazi at caip dot rutgers dot edu>
- Date: Thu, 30 Jan 2003 22:33:29 -0800
- Subject: Re: [PATCH] delegitimize_address target call-back
- References: <200301280228.VAA25828@caip.rutgers.edu> <Pine.LNX.4.44.0301301932350.5532-100000@www.eyesopen.com>
On Thu, Jan 30, 2003 at 08:23:52PM -0700, Roger Sayle wrote:
> [Note that "delegitimize" and "illegitimize" aren't real words
> according to my dictionaries. However, the suggested verb in
> the thesaurus, that is the opposite of legitimize, is "bastardize"
> for both semantics of "legitimate". Given this could cause
> confusion for non-native speakers, and a source of humour to
> native english speakers, I've decided to stick with the more
> neutral/politically-correct "delegitimize_address" :>]
Aww, you're no fun. ;-)
> * hooks.c (hook_rtx_rtx_identity): Generic hook function that
> takes a single rtx and returns it unmodified.
> * hooks.h (hook_rtx_rtx_identity): Prototype here.
> * target.h (struct gcc_target): Add "delegitimize_address"
> field to target structure.
> * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Provide default
> for delegitimize_address target using hook_rtx_rtx_identity.
> (TARGET_INITIALIZER): Initialize delegitimize_address field
> using TARGET_DELEGITIMIZE_ADDRESS macro.
> * simplify-rtx.c (avoid_constant_pool_reference): Handle float
> extensions of constant pool references. Use delegitimize_address
> to undo the obfuscation of "-fpic".
> * Makefile.in (simplify-rtx.o): Add dependency on target.h.
>
> * config/i386/i386.c (ix86_delegitimize_address): New function
> split out from maybe_get_pool_constant to undo the effects of
> legitimize_pic_address.
> (TARGET_DELEGITIMIZE_ADDRESS): Use ix86_delegitimize_address.
> (ix86_find_base_term): Simplify using ix86_delegitimize_address.
> (maybe_get_pool_constant): Likewise.
>
> (ix86_expand_int_addcc): Delete unused local variables pat and
> clob to silence compilation warnings.
The idea is certainly ok. As for the x86 bits, have you noticed
the existing ASM_SIMPLIFY_DWARF_ADDR hook? Seems like that is
doing substantially the same job, but more through.
r~