https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88343
--- Comment #29 from Segher Boessenkool <segher at gcc dot gnu.org> ---
This:
===
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 401e719..f0adef7 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -37988,7 +37988,10 @@ rs6000_call_sysv (rtx value, rtx func_desc, rtx
tlsarg,
&& flag_pic
&& GET_CODE (func_addr) == SYMBOL_REF
&& !SYMBOL_REF_LOCAL_P (func_addr))
- call[n++] = gen_rtx_USE (VOIDmode, pic_offset_table_rtx);
+ {
+ crtl->uses_pic_offset_table = 1;
+ call[n++] = gen_rtx_USE (VOIDmode, pic_offset_table_rtx);
+ }
call[n++] = gen_hard_reg_clobber (Pmode, LR_REGNO);
===
seems to do the trick.