This is the mail archive of the gcc-patches@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]

Re: Patch to improve PIC rtx_unstable_p & rtx_addr_can_trap


> > 	* rtlanal.c (rtx_unstable_p): The pic register is stable
> > 	(within one function) and the actual rtx should be used
> > 	when checking the registers.
> This is not necessarily true.  Consider a target where the PIC register
> is call-clobbered.  Probably the thing to do is check for that explicitly.

I wondered about that, however the existing test in rtx_varies_p
doesn't check PIC_OFFSET_TABLE_REG_CALL_CLOBBERED so I made a leap
of faith and assumed that reload made sure that the pic register
has a valid value in this case.  I take it that this isn't true?
Should I go ahead and install the patch changing the check in
rtx_unstable_p from:

  || x == pic_offset_table_rtx

to:

  #if !defined(PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
    || x == pic_offset_table_rtx
  #endif

and make the same change to rtx_varies_p?


> > 	(rtx_addr_can_trap_p): Pic memory addresses can't trap.
> Assuming the linker & friends all DTRT :-)

Well ... yes.  A lot of things in the compiler don't work when
the linker & friends DTWT :-(

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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