$OpenBSD: patch-gcc_config_arm_arm_c,v 1.1 2013/01/27 15:00:23 tobiasu Exp $
--- gcc/config/arm/arm.c.orig	Sat Jan 26 16:31:12 2013
+++ gcc/config/arm/arm.c	Sat Jan 26 16:32:40 2013
@@ -3216,7 +3216,8 @@ legitimize_pic_address (rtx orig, enum machine_mode mo
 	  gcc_assert (!no_new_pseudos);
 	  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
@@ -3228,7 +3229,8 @@ legitimize_pic_address (rtx orig, enum machine_mode mo
 	    {
 	      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
