------- Comment #11 from spark at gcc dot gnu dot org 2007-06-14 03:53 ------- (In reply to comment #10) > Subject: Re: [4.3 Regression] Bootstrap failure in stage1 on hppa*-*-* > > > It's my turn to ask: so what information does hppa_can_use_return_p > > need to make the decision ? > > We need to know that the return pointer (r2) is not used and that > the function is a leaf function (i.e., that the incoming value in > r2 is unchanged). Calls clobber r2. > > Dave
Sounds like the following patch would work: diff -r 149399c845b5 gcc/config/pa/pa.c --- a/gcc/config/pa/pa.c Tue Jun 12 15:49:27 2007 -0700 +++ b/gcc/config/pa/pa.c Wed Jun 13 18:37:17 2007 -0700 @@ -4415,7 +4415,7 @@ hppa_can_use_return_insn_p (void) { return (reload_completed && (compute_frame_size (get_frame_size (), 0) ? 0 : 1) - && df_hard_reg_used_count (2) == 1 + && DF_REG_DEF_COUNT (2) == 0 && ! frame_pointer_needed); } This essentially checks if r2 is ever written within the function (including the calls since r2 is included in the CALL_USED_REGS). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32296