The PR is about unnecessary saves of the pic base register, it shows on m32 Linux and m32/m64 Darwin.
The fix is to check that we are in a pic mode and that the picbase has actually been used.
As a bonus, some #ifdef’d TARGET_MACHO code is no longer required.
2018-12-12 Segher Boessenkool <segher@kernel.crashing.org>
Iain Sandoe <iain@sandoe.co.uk>
PR target/88343
* config/rs6000/rs6000.c (save_reg_p): Do not save the picbase reg
unless it has been used.
(first_reg_to_save): Remove dead code.
Co-Authored-By: Iain Sandoe <iain@sandoe.co.uk>
From-SVN: r267049
+2018-12-12 Segher Boessenkool <segher@kernel.crashing.org>
+ Iain Sandoe <iain@sandoe.co.uk>
+
+ PR target/88343
+ * config/rs6000/rs6000.c (save_reg_p): Do not save the picbase reg
+ unless it has been used.
+ (first_reg_to_save): Remove dead code.
+
2018-12-12 Iain Sandoe <iain@sandoe.co.uk>
* config/rs6000/rs6000-protos.h (rs6000_call_darwin): New.
return true;
if ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN)
- && flag_pic)
+ && flag_pic && crtl->uses_pic_offset_table)
return true;
}
if (save_reg_p (first_reg))
break;
-#if TARGET_MACHO
- if (flag_pic
- && crtl->uses_pic_offset_table
- && first_reg > RS6000_PIC_OFFSET_TABLE_REGNUM)
- return RS6000_PIC_OFFSET_TABLE_REGNUM;
-#endif
-
return first_reg;
}