This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Removing REG_OK_STRICT


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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]