[PATCH] -fpic problems on PPC, a different approach

Jeffrey A Law law@cygnus.com
Mon Jun 7 18:31:00 GMT 1999


  In message < 99060801443500.01516@ns1102.munich.netsurf.de >you write:
  > Ok, thought so :-). But would it be possible? Just to check if I got some
  > of the internals interpreted correctly.
Hard to tell.  I don't think that the REG_DEAD movement would be correct.  What
you would need to do instead is to make the pic register live at all suitable
REG_EQUAL notes that propagate that through the flow graph when initially 
computing the REG_EQUAL notes.

I would have recommended against checking for CONST_DOUBLEs explicitly;  
instead
I would have suggested either using LEGITIMATE_PIC_OPERAND_P to determine
what REG_EQUALs could potentially cause you problems later.

This makes me wonder about another way to fix this, if indeed it can only
happen when we have REG_EQUIVs that reference CONST_DOUBLEs.

You can force reload to ignore those constants in REG_EQUIV notes by defining
LEGITIMATE_PIC_OPERAND_P to reject a CONST_DOUBLE.    


  > Ok, so we head for a separate pic register. Let's see if I can come up with
  > a patch in time for 2.95. Did anyone already check (or as an idea about it)
  > how much work this would be in the backend?
Should be simple.

Define CONDITIONAL_REGISTER_USAGE to fix a suitable register if PIC code
generation is requested.  Then define PIC_OFFSET_TALBE_REGNUM.

Keep track of whether or not you ever reference the pic register.  If you
do, then you'll need to load it up at appropriate times.  Else you ignore
it completely.
jeff




More information about the Gcc-patches mailing list