[gnu.gcc.bug] How to force register-only data addressing?

mckenney@pawl.rpi.edu (Bruce McKenney) (12/05/89)

  I believe I have a first approximation of a port of GCC to the IBM 370.
I think I'm beginning to get the hang of all this, but I'm still having
a few troubles, and I'd like to tap the net's wisdom on one specific
and one general question.

  The specific question deals with data addressing. The 370's 12-bit
operand offset value is small enough to render it useless in addressing
arbitrary locations in the data segment(s); thus, any such reference 
must (in general) be preceded by a load of some register with the 
address of the datum, with the reference then going indirectly
through said register. The question, then, is: how to do this?
  Conceptually, what I (think I) want to do is force any rtx of the form
(mem:XX (symbol_ref:XX ("YYYY"))) to go first through the standard
"load_address" insn pattern to load the address of YYYY into a register,
but I don't see any general way of doing this. I'd like to do this in a way
that gives the compiler enough information to schedule the use
of these address registers intelligently.
  The LEGITIMATE_ADDRESS macros appear to be trying to deal with this, but
they also appear to be overkill for this purpose (e.g., they seem to affect
the "load_address" operands as well). Do I want a custom constraint 
function (general_operand_address_in_register)? Am I just looking at this
the wrong way?

  More generally, has anyone had occasion to write a "porting cheat sheet"
to go along with the Porting Guide, some sort of informal writeup with hints 
on how to approach such problems? (E.g., was Mr. Tower's Usenix talk from
a few years back ever transcribed?) I don't mind solving things for myself,
but I'd like to stand on others' proverbial shoulders if possible.

  Thanks in advance for any advice.

  Bruce McKenney, ITS, RPI
  mckenney@pawl.rpi.edu
  mckenney@itsgw.rpi.edu
  Bruce_McKenney@mts.rpi.edu