When STATIC_CHAIN_REGNUM is defined and the static chain register is not a fixed register, I am assuming that the prologue need to save it and that df_regs_ever_live_p must be checked to determine whether to save it. The uncertainty arise when one cannot tell which GCC internal variable must be checked beside df_regs_ever_live_p ; ie: https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/gcc/config/fr30/fr30.c#L145 Hence the reason for asking for examples showing how to properly have the DF entry block define registers so that it is enough to check only df_regs_ever_live_p in the prologue on whether to save them. Are they currently such examples ? On Fri, Apr 5, 2019 at 11:23 PM William Tambe <tambewilliam@xxxxxxxxx> wrote: > > are they examples showing how to properly have the entry block define > the frame pointer and return address so that it is enough to check > df_regs_ever_live_p with no need to check respectively > frame_pointer_needed and crtl->profile ? > > On Fri, Apr 5, 2019 at 10:12 PM Segher Boessenkool > <segher@xxxxxxxxxxxxxxxxxxx> wrote: > > > > On Fri, Apr 05, 2019 at 09:25:08PM -0500, William Tambe wrote: > > > What is the reason that GCC does not always automatically include the > > > frame-pointer and return-address registers in df_regs_ever_live_p such > > > that it is necessary to check respectively frame_pointer_needed and > > > crtl->profile ? ie: > > > https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/gcc/config/fr30/fr30.c#L145 > > > > The code that actually sets up the frame pointer or return address is not > > yet necessarily part of the rtl stream where these checks are used. The > > prologue code is inserted in the pro_and_epilogue pass, which runs a bit > > _after_ reload (or LRA, in the more modern world). So DF does not see > > those insns yet, because they simply do not exist yet ;-) > > > > The target can make sure the entry block defines these regs, but it sounds > > like fr30 did not do that. > > > > > > Segher