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 register elimination


> Ask the same questions without my patch and
> assume that the offset from fp->sp is known in which case the same situation
> is created.  What guarantees that the big loop will iterate again?  Maybe
> nothing in which case reload is missing a chance to make another register
> available, however the code produced should still be legal.

Actually it occurs to me that the code may not be legal since
frame_pointer_needed may not be set.

>   1) Current code ... offsets are all known.
> 
>      First iteration ap->fp.
>      update_eliminables is called, however no eliminations changed.
>      finish_spills has nothing to do and returns zero.
>      Big loop exits.

The problem here is that the fp->sp elimination is enabled so
update_eliminables will have cleared frame_pointer_needed even though
the code in fact requires a frame.

>   4) My patch ... fp->sp offset is not known.
> 
>      First iteration ap->fp.
>      update_eliminables is called, however no eliminations changed.
>      finish_spills has nothing to do and returns zero.
>      Big loop exits.

This is the same problem as #1.

As far as I can tell my patch doesn't introduce any new problems, however
I would be happier if we could establish that the existing code does in
fact do the right thing.  At the moment I don't understand how the existing
code is guaranteed to do this given the situation you are suggesting.

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