This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: check reload_completed and frame_pointer_needed (Bug in simplify_subreg?)
- From: Lars Brinkhoff <lars dot spam at nocrew dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Henderson <rth at redhat dot com>, Richard dot Earnshaw at arm dot com
- Date: 07 Aug 2002 15:43:07 +0200
- Subject: PATCH: check reload_completed and frame_pointer_needed (Bug in simplify_subreg?)
- Organization: nocrew
- References: <200208071213.NAA04678@cam-mail2.cambridge.arm.com>
(See thread starting at http://gcc.gnu.org/ml/gcc/2002-08/msg00072.html)
rth wrote:
> > gen_reg_RTX should check reload_compled && frame_pointer_needed.
Richard Earnshaw <rearnsha@arm.com> writes:
> After reload we should certainly not be returning frame_pointer_rtx
> on the ARM, or any other platform that defines HARD_FRAME_POINTER_REGNUM.
So is this patch acceptable? It solves my problem.
Bootstrapped and checked on powerpc-unknown-linux-gnu (which doesn't
define HARD_FRAME_POINTER_REGNUM). (I don't have CVS write access.)
2002-08-07 Lars Brinkhoff <lars@nocrew.org>
* emit-rtl.c (gen_rtx_REG):
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.289
diff -u -r1.289 emit-rtl.c
--- emit-rtl.c 5 Aug 2002 18:46:32 -0000 1.289
+++ emit-rtl.c 7 Aug 2002 13:35:32 -0000
@@ -514,7 +514,8 @@
if (mode == Pmode && !reload_in_progress)
{
- if (regno == FRAME_POINTER_REGNUM)
+ if (regno == FRAME_POINTER_REGNUM
+ && (!reload_completed || frame_pointer_needed))
return frame_pointer_rtx;
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
if (regno == HARD_FRAME_POINTER_REGNUM)