This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Combiner fixes
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <rearnsha at arm dot com>
- Date: Tue, 03 Aug 2010 09:24:06 +0200
- Subject: Re: Combiner fixes
- References: <4C572CA0.3040802@codesourcery.com>
On 08/02/2010 10:37 PM, Bernd Schmidt wrote:
+ if (GET_CODE (op0) == NEG && CONST_INT_P (trueop1))
+ return simplify_gen_binary (MULT, mode, XEXP (op0, 0),
+ simplify_gen_unary (NEG, mode, op1, mode));
Why not go one step further and try it on all operands:
if (GET_CODE (op0) == NEG)
{
rtx temp = simplify_unary (NEG, mode, op1, mode);
if (temp)
return simplify_gen_binary (MULT, mode, XEXP (op0, 0), temp);
}
if (GET_CODE (op1) == NEG)
{
rtx temp = simplify_unary (NEG, mode, op0, mode);
if (temp)
return simplify_gen_binary (MULT, mode, temp, XEXP (op1, 0));
}
Paolo