rl78.c (need_to_save): Save register 22 if it is used, even if it is not being used...
authorNick Clifton <nickc@redhat.com>
Wed, 6 May 2015 10:19:07 +0000 (10:19 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Wed, 6 May 2015 10:19:07 +0000 (10:19 +0000)
* config/rl78/rl78.c (need_to_save): Save register 22 if it is
used, even if it is not being used as a frame pointer.

From-SVN: r222845

gcc/ChangeLog
gcc/config/rl78/rl78.c

index fc88220cc838a7a2e9bbf6af38f6d5f6467fbe3e..2593a3c7f99cab26d5f21216010465382e151c7f 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-06  Nick Clifton  <nickc@redhat.com>
+
+       * config/rl78/rl78.c (need_to_save): Save register 22 if it is
+       used, even if it is not being used as a frame pointer.
+
 2015-05-05  Jason Merrill  <jason@redhat.com>
 
        * dwarf2out.c (gen_member_die): Don't emit anything for an
index 0ca5515f84e07a37a6dafbb10334495bc330e823..48318931404fa20d24d2dd6431a92f9a0320b957 100644 (file)
@@ -687,7 +687,8 @@ need_to_save (unsigned int regno)
       return df_regs_ever_live_p (regno);
     }
 
-  if (regno == FRAME_POINTER_REGNUM && frame_pointer_needed)
+  if (regno == FRAME_POINTER_REGNUM
+      && (frame_pointer_needed || df_regs_ever_live_p (regno)))
     return true;
   if (fixed_regs[regno])
     return false;