This is the mail archive of the gcc-bugs@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]

Re: target/7856: [arm] invalid offset in constant pool reference


On Tue, 2002-09-10 at 11:45, Richard Earnshaw wrote:
> 
> > Okay, that's cool.  Anyone volunteering to make a patch, or shall I do
> > it?
> > 
> 
> Feel free.

Something like this, I guess.

p.

2002-09-12  Philip Blundell  <philb@gnu.org>

	* config/arm/arm.c (use_return_insn): Fail if LR was not
	pushed but other integer registers were.

Index: arm.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.196.2.5
diff -u -p -r1.196.2.5 arm.c
--- arm.c	21 Jul 2002 12:09:02 -0000	1.196.2.5
+++ arm.c	12 Sep 2002 09:48:50 -0000
@@ -890,6 +890,7 @@ use_return_insn (iscond)
 {
   int regno;
   unsigned int func_type;
+  unsigned int save_reg_mask;
 
   /* Never use a return instruction before reload has run.  */
   if (!reload_completed)
@@ -935,6 +936,12 @@ use_return_insn (iscond)
     for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++)
       if (regs_ever_live[regno] && !call_used_regs[regno])
 	return 0;
+
+  /* Can't be done if LR was not pushed but other GP registers were.  */
+  save_reg_mask = arm_compute_save_reg_mask ();
+  if ((save_reg_mask & (1 << LR_REGNUM)) == 0
+      && save_reg_mask & ((1 << LR_REGNUM) - 1))
+    return 0;
 
   return 1;
 }


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