Kenneth Zadeck <zadeck@naturalbridge.com> writes:
+
+/* With -mabicalls (which is the default on GNU/Linux),
+ PIC_FUNCTION_ADDR_REGNUM is live on function entry and is to
+ initialize $28, which is PIC_OFFSET_TABLE_REGNUM. */
+
+void
+mips_set_live_on_entry (void *regsv)
+{
+ bitmap regs = (bitmap) regsv;
+ bitmap_set_bit (regs, PIC_FUNCTION_ADDR_REGNUM);
+}
Minor quibble, but I'd prefer it if the function name matched the macro
(s/mips_set/mips_extra/). Also, the comment about -mabicalls being the
default on GNU/Linux is superfluous. A comment along the lines of:
/* Implement TARGET_EXTRA_LIVE_ON_ENTRY. TARGET_ABICALLS makes
PIC_FUNCTION_ADDR_REGNUM live on entry to a function. */
would be fine.
More importantly, why are you adding the register unconditionally?
The register _isn't_ live on entry if !TARGET_ABICALLS.