This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH for [ARM] subsequent use of plus and minus operators could be improved
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Gábor Lóki <alga at rgai dot hu>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Richard dot Earnshaw at arm dot com
- Date: Mon, 31 Mar 2003 10:58:40 +0100
- Subject: Re: PATCH for [ARM] subsequent use of plus and minus operators could be improved
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> This patch solves the "[ARM] subsequent use of plus and
> minus operators could be improved" PR.
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10242
>
> This patch uses peephole pattern to simplify subsequent
> plus-minus operators.
>
This is a potential problem for many platforms, not just ARM, so we should
be looking for a generic solution. These multiple add/subtract sequences
are generated by register elimination during reload. I therefore believe
that reload_cse should be responsible for cleaning them up.
> It also includes peepholes for special cases of set register
> with "x - 0" or "x + 0".
These just should not be occuring; proper expanders will be using
plus_constant to generate the addend, which would automatically simplify
any addition of zero into a move.
R.