@@ -19480,9 +19480,7 @@ arm_compute_save_reg0_reg12_mask (void)
save_reg_mask |= (1 << reg);
/* Also save the pic base register if necessary. */
- if (flag_pic
- && !TARGET_SINGLE_PIC_BASE
- && arm_pic_register != INVALID_REGNUM
+ if (PIC_REGISTER_MAY_NEED_SAVING
&& crtl->uses_pic_offset_table)
save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
}
@@ -19514,9 +19512,7 @@ arm_compute_save_reg0_reg12_mask (void)
/* If we aren't loading the PIC register,
don't stack it even though it may be live. */
- if (flag_pic
- && !TARGET_SINGLE_PIC_BASE
- && arm_pic_register != INVALID_REGNUM
+ if (PIC_REGISTER_MAY_NEED_SAVING
&& (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM)
|| crtl->uses_pic_offset_table))
save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
@@ -1949,6 +1949,13 @@ extern unsigned arm_pic_register;
|| label_mentioned_p (get_pool_constant (X))))) \
|| tls_mentioned_p (X))
+/* We may want to save the PIC register if it is a dedicated one. */
+#define PIC_REGISTER_MAY_NEED_SAVING \
+ (flag_pic \
+ && !TARGET_SINGLE_PIC_BASE \
+ && !TARGET_FDPIC \
+ && arm_pic_register != INVALID_REGNUM)
+
/* We need to know when we are making a constant pool; this determines
whether data needs to be in the GOT or can be referenced via a GOT
offset. */