public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [arm] Fix thumb -fPIC
@ 2004-10-01 16:25 Paul Brook
  2004-10-12 11:59 ` Richard Earnshaw
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Brook @ 2004-10-01 16:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Earnshaw

Patch below fixes a couple of bugswhen generating thumb PIC code.
One we are ORing with a register number rather than a bitmask. the other we 
weren't searching all low regs when looking for a work register.

Tested with cross to arm-none-elf.
Applied as obvious to csl-arm-branch and mainline as this has been discussed 
before.

Paul

2004-01-01  Paul Brook  <paul@codesourcery.com>

 * config/arm/arm.c (thumb_compute_saved_rag_mask): Or with bitmask,
 not register number.
 (thumb_find_work_register): Search full register range.

Index: gcc/config/arm/arm.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.303.2.58
diff -u -p -r1.303.2.58 arm.c
--- gcc/config/arm/arm.c 30 Sep 2004 21:45:04 -0000 1.303.2.58
+++ gcc/config/arm/arm.c 1 Oct 2004 15:22:59 -0000
@@ -3040,7 +3040,7 @@ thumb_find_work_register (int live_regs_
     return LAST_ARG_REGNUM;
 
   /* Look for a pushed register.  */
-  for (reg = 0; reg < LAST_LO_REGNUM; reg++)
+  for (reg = LAST_LO_REGNUM; reg >=0; reg--)
     if (live_regs_mask & (1 << reg))
       return reg;
 
@@ -9178,7 +9178,7 @@ thumb_compute_save_reg_mask (void)
     }
 
   if (flag_pic && !TARGET_SINGLE_PIC_BASE)
-    mask |= PIC_OFFSET_TABLE_REGNUM;
+    mask |= (1 << PIC_OFFSET_TABLE_REGNUM);
   if (TARGET_SINGLE_PIC_BASE)
     mask &= ~(1 << arm_pic_register);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-13  8:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-01 16:25 [arm] Fix thumb -fPIC Paul Brook
2004-10-12 11:59 ` Richard Earnshaw
2004-10-12 19:14   ` Paul Brook
2004-10-13  9:08     ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).