This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Removing REG_OK_STRICT
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: zack at codesourcery dot com, gcc at gcc dot gnu dot org
- Date: 04 Feb 2004 14:52:26 -0800
- Subject: Re: Removing REG_OK_STRICT
- References: <20040204.172803.66537971.kazu@cs.umass.edu>
Kazu Hirata <kazu@cs.umass.edu> writes:
> Hi,
>
> I'm thinking about removing REG_OK_STRICT as it's one of the dirtiest
> macro. (It controls "overloading" of target macros like
> REG_OK_FOR_INDEX_P.)
>
> Here is my plan:
>
> 1. For each port, make it look like i386.h. That is, do something
> like
>
> /* Define both nonstrict and strict versions. */
> #define REG_OK_FOR_INDEX_NONSTRICT_P(X) blah
> #define REG_OK_FOR_INDEX_STRICT_P(X) blah
>
> /* All REG_OK_STRICT does is to choose one of the two. */
> #ifndef REG_OK_STRICT#
> #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X)
> #else
> #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P (X)
> #endif
>
> Note that some ports like alpha, i386, avr, and h8300 do this.
>
> 2. Change each use of REG_OK_FOR_*_P to either the strict or the
> nonstrict version.
>
> 3. Remove REG_OK_STRICT as well as all definitions of
> REG_OK_FOR_INDEX_P and its friends that do not have "STRICT"
> appearing in their names.
>
> 4. Finally ready for hookizing REG_OK_FOR_BASE_{STRICT,NONSTRICT}_P
> and its friends.
>
> Suggestions? OK as far as the basic idea?
That sounds reasonable to me, although I would suggest that it might
be better to have the hooks take a bool 'strict' parameter, so that you have
if (targetm.reg_ok_for_index (reg, true)) ... ;
(This only affects step 4. Steps 1-3 look fine to me as-is.)
--
- Geoffrey Keating <geoffk@geoffk.org>