OSDN Git Service

2009-02-24 Julian Brown <julian@codesourcery.com>
authordougkwan <dougkwan@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Feb 2009 07:18:01 +0000 (07:18 +0000)
committerdougkwan <dougkwan@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Feb 2009 07:18:01 +0000 (07:18 +0000)
PR target/35965
* config/arm/arm.c (require_pic_register): Only set
cfun->machine->pic_reg once per function.

Patch commited by Doug Kwan <dougkwan@google.com>

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

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

index fb344c8..64eded2 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-24  Julian Brown  <julian@codesourcery.com>
+
+       PR target/35965
+       * config/arm/arm.c (require_pic_register): Only set
+       cfun->machine->pic_reg once per function.
+
 2009-02-24  Sandra Loosemore  <sandra@codesourcery.com>
 
        * doc/invoke.texi (Link Options): Document an easier way to pass
index c25fc29..662e7de 100644 (file)
@@ -3563,7 +3563,8 @@ require_pic_register (void)
       gcc_assert (can_create_pseudo_p ());
       if (arm_pic_register != INVALID_REGNUM)
        {
-         cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register);
+         if (!cfun->machine->pic_reg)
+           cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register);
 
          /* Play games to avoid marking the function as needing pic
             if we are being called as part of the cost-estimation
@@ -3575,7 +3576,8 @@ require_pic_register (void)
        {
          rtx seq;
 
-         cfun->machine->pic_reg = gen_reg_rtx (Pmode);
+         if (!cfun->machine->pic_reg)
+           cfun->machine->pic_reg = gen_reg_rtx (Pmode);
 
          /* Play games to avoid marking the function as needing pic
             if we are being called as part of the cost-estimation