]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
spu.c (get_pic_reg): Use LAST_ARG_REGNUM as PIC registers in leaf functions if possible.
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 17 Nov 2009 16:10:03 +0000 (16:10 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 17 Nov 2009 16:10:03 +0000 (16:10 +0000)
* config/spu/spu.c (get_pic_reg): Use LAST_ARG_REGNUM as PIC
registers in leaf functions if possible.

From-SVN: r154252

gcc/ChangeLog
gcc/config/spu/spu.c

index efbcb8554430f22c529293bf49b1a7719b105f71..6b8bb8da5e76c4c4b3fe88b2c66a163b491bb140 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-17  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * config/spu/spu.c (get_pic_reg): Use LAST_ARG_REGNUM as PIC
+       registers in leaf functions if possible.
+
 2009-11-14  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/predicates.md (call_register_no_elim_operand):
index 811bf5aef092ef7b7878f2107a3268c71398b7b1..8c9a8d287e68fae6153706258435fa33ef385808 100644 (file)
@@ -1614,6 +1614,8 @@ get_pic_reg (void)
   rtx pic_reg = pic_offset_table_rtx;
   if (!reload_completed && !reload_in_progress)
     abort ();
+  if (current_function_is_leaf && !df_regs_ever_live_p (LAST_ARG_REGNUM))
+    pic_reg = gen_rtx_REG (SImode, LAST_ARG_REGNUM);
   return pic_reg;
 }