This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix for ARM prologue construction failures
- To: Nick Clifton <nickc at redhat dot com>
- Subject: Re: Fix for ARM prologue construction failures
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Fri, 05 Jan 2001 19:15:31 +0000
- Cc: gcc-patches at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
> 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.