This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/32296] [4.3 Regression] Bootstrap failure in stage1 on hppa*-*-*
- From: "spark at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jun 2007 03:53:48 -0000
- Subject: [Bug rtl-optimization/32296] [4.3 Regression] Bootstrap failure in stage1 on hppa*-*-*
- References: <bug-32296-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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