This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] GCSE the content of REG_EQUAL/REG_EQUIV notes as well
- From: Ian Lance Taylor <ian at airs dot com>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: 23 Nov 2005 15:23:47 -0800
- Subject: Re: [PATCH] GCSE the content of REG_EQUAL/REG_EQUIV notes as well
- References: <4384AB11.2050305@lu.unisi.ch>
Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:
> 2005-11-23 Paolo Bonzini <bonzini@gnu.org>
>
> * gcse.c (hash_scan_set): Look through REG_EQUAL or REG_EQUIV notes
> also when doing PRE, rather than only for global CPROP.
This is OK if you fix the comment.
> /* If this is a single set and we are doing constant propagation,
> see if a REG_NOTE shows this equivalent to a constant. */
> - if (table->set_p && (note = find_reg_equal_equiv_note (insn)) != 0
> - && gcse_constant_p (XEXP (note, 0)))
> + note = find_reg_equal_equiv_note (insn);
> + if (note != 0
> + && (table->set_p
> + ? gcse_constant_p (XEXP (note, 0))
> + : want_to_gcse_p (XEXP (note, 0))))
> src = XEXP (note, 0), pat = gen_rtx_SET (VOIDmode, dest, src);
The comment says we are only going to look at a note when doing
constant propagation, and your patch changes that.
Thanks.
Ian