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: Fix for ARM prologue construction failures


> Hi Guys,
> 
>   I am checking in the patch below to fix a bug in the reorganisation
>   of ARM function prologue generation that I recently made.  This
>   patch fixes several gcc testsuite failures.
> 
>   The problem was that if the prologue decided not to save the link
>   register onto the stack, the second conditional execution pass would
>   find it and use it to hold scratch values, totally destroying the
>   return address.  The patch adds a USE of the link register to
>   prevent this, and makes sure that the epilogue code is not fooled by
>   the fact that the link register has now become set in
>   regs_ever_live[].

I don't think a USE will be sufficient to prevent this scavenging, 
particularly if a function has multiple basic blocks.  There should 
probably be code in the CE pass that checks if it is safe to use a 
particular register (in the same way that the regrename pass does this 
with HARD_REGNO_RENAME_OK).

R.




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