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]
Other format: [Raw text]

PATCH: check reload_completed and frame_pointer_needed (Bug in simplify_subreg?)


(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)


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