2007-07-12 Paul Brook <paul@codesourcery.com>
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Jul 2007 21:28:27 +0000 (21:28 +0000)
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Jul 2007 21:28:27 +0000 (21:28 +0000)
gcc/
* config/arm/arm.c (thumb1_compute_save_reg_mask): Make sure scratch
reg does not overlap return value.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126604 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c

index 8502ba0..806a057 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-12  Paul Brook  <paul@codesourcery.com>
+
+       * config/arm/arm.c (thumb1_compute_save_reg_mask): Make sure scratch
+       reg does not overlap return value.
+
 2007-07-12  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree-ssa-pre.c (get_expression_vuses): Move out side-effect.
index 6e99371..5569d4a 100644 (file)
@@ -10182,6 +10182,10 @@ thumb1_compute_save_reg_mask (void)
         have to push it.  Use LAST_LO_REGNUM as our fallback
         choice for the register to select.  */
       reg = thumb_find_work_register (1 << LAST_LO_REGNUM);
+      /* Make sure the register returned by thumb_find_work_register is
+        not part of the return value.  */
+      if (reg * UNITS_PER_WORD <= arm_size_return_regs ())
+       reg = LAST_LO_REGNUM;
 
       if (! call_used_regs[reg])
        mask |= 1 << reg;