This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: target/7856: [arm] invalid offset in constant pool reference
- From: Philip Blundell <pb at nexus dot co dot uk>
- To: Richard dot Earnshaw at arm dot com
- Cc: Nick Clifton <nickc at redhat dot com>, gcc-bugs at gcc dot gnu dot org
- Date: 12 Sep 2002 10:52:51 +0100
- Subject: Re: target/7856: [arm] invalid offset in constant pool reference
- References: <200209101045.g8AAjaE17185@pc960.cambridge.arm.com>
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;
}