@@ -4378,6 +4378,19 @@ ix86_offload_options (void)
return xstrdup ("-foffload-abi=ilp32");
}
+/* Return 1 if pseudo register should be created and used to hold
+ GOT address for PIC code. */
+static bool
+ix86_use_pseudo_pic_reg (void)
+{
+ if ((TARGET_64BIT
+ && (ix86_cmodel == CM_SMALL_PIC
+ || TARGET_PECOFF))
+ || !flag_pic)
+ return false;
+ return true;
+}
+
/* Update register usage after having seen the compiler flags. */
static void
@@ -4388,7 +4401,7 @@ ix86_conditional_register_usage (void)
/* The PIC register, if it exists, is fixed. */
j = PIC_OFFSET_TABLE_REGNUM;
- if (j != INVALID_REGNUM)
+ if (j != INVALID_REGNUM && !ix86_use_pseudo_pic_reg ())
fixed_regs[j] = call_used_regs[j] = 1;
/* For 32-bit targets, squash the REX registers. */
@@ -6254,19 +6267,6 @@ ix86_maybe_switch_abi (void)
reinit_regs ();
}
-/* Return 1 if pseudo register should be created and used to hold
- GOT address for PIC code. */
-static bool
-ix86_use_pseudo_pic_reg (void)
-{
- if ((TARGET_64BIT
- && (ix86_cmodel == CM_SMALL_PIC
- || TARGET_PECOFF))
- || !flag_pic)
- return false;
- return true;
-}
-
/* Initialize large model PIC register. */
static void