This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: [4.1/4.2 Regression]: Miscompiled FORTRAN program
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Joern RENNECKE <joern dot rennecke at st dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, grigory_zagorodnev at linux dot intel dot com, denis_nagorny at linux dot intel dot com
- Date: Tue, 14 Feb 2006 13:43:44 -0800
- Subject: Re: PATCH: [4.1/4.2 Regression]: Miscompiled FORTRAN program
- References: <43F248FB.8050604@st.com>
On Tue, Feb 14, 2006 at 09:17:47PM +0000, Joern RENNECKE wrote:
> >2006-02-13 Denis Nagorny <denis_nagorny@linux.intel.com>
> >
> > PR rtl-optimization/25603
> > * reload.c (reg_inc_found_and_valid_p): New.
> > (regno_clobbered_p): Handle REG_INC as 25603 workaround.
>
> You have to check every use of regno_clobbered_p to verify your change
> will be appropriate. E.g. The followingh code in
> reload1.c:emit_output_reload_insns is bound to break with your patch,
> when a hard register not suitable for auto-increment is reloaded
> into another register because the value is needed as an auto-increment
> address in a MEM which is SET_SRC (single_set (insn)):
>
>
> /* Don't output the last reload if OLD is not the dest of
> INSN and is in the src and is clobbered by INSN. */
> if (! flag_expensive_optimizations
> || !REG_P (old)
> || !(set = single_set (insn))
> || rtx_equal_p (old, SET_DEST (set))
> || !reg_mentioned_p (old, SET_SRC (set))
> || !((REGNO (old) < FIRST_PSEUDO_REGISTER)
> && regno_clobbered_p (REGNO (old), insn, rl->mode, 0)))
> gen_reload (old, reloadreg, rl->opnum,
> rl->when_needed);
Joern, can you explain it a little in detail why Denis' patch will
break it? Denis and I aren't very familiar with this area of gcc.
Thanks.
H.J.