Working on the pdp11 target, I ran into something odd.

It defines REGNO_OK_FOR_BASE_P in a way that seems to match what gccint says 
one should do in the "strict" case -- but does so all the time.  Specifically, 
it says:

#define REGNO_OK_FOR_BASE_P(REGNO) \
  ((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)

(8 because there are 8 general registers on the PDP11, all suitable as base.)

It then defines another similarly named macro REG_OK_FOR_BASE_P which takes an 
rtx instead of a regno, for use in GO_IF_LEGITIMATE_ADDRESS.  That second macro 
*does* come with a non-strict form which accepts all registers.

Looking at gccint, that seemed wrong.  As far as I can tell, REG_OK_FOR_BASE_P 
is not (or no longer) a standard macro so it's just a convenience macro inside 
the target.  No problem there.  But the strict REGNO_OK_FOR_BASE_P in 
non-strict settings seemed like an issue, so I changed it.

The surprise it that it makes no difference.  No change in code, no change in 
testsuite results.  Why didn't it matter?  Is the documentation wrong?  Or is 
the existing definition somehow ok even for the non-strict case, in a way that 
isn't obvious?

        paul

Reply via email to