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 find_base_term ADDRESSOF handling


>    +     case ADDRESSOF:
>    +       return stack_pointer_rtx;
>
> Why the stack pointer?  I'd think FP was better.  Or one of the virtual
> registers.  Can you say more here?

I was thinking too low level.  purge_addressof uses assign_stack_local_1
which has:

    addr = plus_constant (frame_pointer_rtx,
                          (frame_offset + bigend_correction
                           + STARTING_FRAME_OFFSET));

so I should probably change:

    case ADDRESSOF:
      return REG_BASE_VALUE (stack_pointer_rtx);

(which is actually what was installed) to

    case ADDRESSOF:
      return REG_BASE_VALUE (frame_pointer_rtx);

Okay to install with an appropriate ChangeLog entry once I've bootstrapped
and passed make check?

-- 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]