This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix a bad regmove transformation - SPEC CPU2k 186.crafty regression on dataflow branch.
- From: Ian Lance Taylor <iant at google dot com>
- To: "Seongbae Park" <seongbae dot park at gmail dot com>
- Cc: "gcc-patches >> GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Kenneth Zadeck" <zadeck at naturalbridge dot com>
- Date: 21 Mar 2007 18:50:29 -0700
- Subject: Re: [PATCH] Fix a bad regmove transformation - SPEC CPU2k 186.crafty regression on dataflow branch.
- References: <ab3a61990703211829m3c75ddaod20877f90e6b915e@mail.gmail.com>
"Seongbae Park" <seongbae.park@gmail.com> writes:
> 2007-03-21 Seongbae Park <seongbae.park@gmail.com>
>
> * regmove.c (regmove_optimize): Use REG_MENTIONED_P
> instead of REG_OVERLAP_MENTIONED_P for DST.
Use lower-case for function names in the ChangeLog entry.
> Index: gcc/regmove.c
> ===================================================================
> --- gcc/regmove.c (revision 123123)
> +++ gcc/regmove.c (working copy)
> @@ -1429,8 +1429,13 @@ regmove_optimize (rtx f, int nregs)
> break;
> }
>
> + /* REG_OVERLAP_MENTIONED_P returns false
> + if REG is written but not read by the rtx P.
> + However, we want to check for any writes to DST
> + because we're going to extend the live range of DST
> + so that it lives over the insn P. */
> if (reg_overlap_mentioned_p (src, PATTERN (p))
> - || reg_overlap_mentioned_p (dst, PATTERN (p)))
> + || reg_mentioned_p (dst, PATTERN (p)))
> break;
Use lower case for function names in the comment, too (arrgghh! so
many inconsistencies!).
Also, the comment describes why the change was made, which is not
wholly helpful to somebody coming to this code fresh. How about
something along the lines of:
/* We can't make this change if SRC is read or partially written in P,
since we are going to eliminate SRC. We can't make this change if
DST is mentioned at all in P, since we are going to change its
value. */
OK with the comment change if testing passes.
Thanks.
Ian