This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Ensure valid RTL from simplify_expand_binop (PR 25662)
- From: Roger Sayle <roger at eyesopen dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>, Ian Lance Taylor <ian at airs dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 7 Jan 2006 12:48:10 -0700 (MST)
- Subject: Re: [PATCH] Ensure valid RTL from simplify_expand_binop (PR 25662)
On Sat, 7 Jan 2006, David Edelsohn wrote:
> 2005-01-07 Ian Lance Taylor <ian@airs.com>
> David Edelsohn <edelsohn@gnu.org>
>
> PR rtl-optimization/25662
> * optabs.c (simplify_expand_binop): Use simplify_binary_operation
> for constant operands instead of simplify_gen_binary.
> * simplify-rtx.c (simplify_gen_binary): Swap commutative operands
> after trying simplify_binary_operation
This is OK for mainline. Thanks.
This is clearly an improvement over mainline, though there may still
be a latent bug here. You might consider drilling even deeper in
simplify-rtx.c and calling "simplify_const_binary_operation" which
is guaranteed to return a constant result or NULL. The other path
via simplify_binary_operation_1 is for transforming expressions rather
than evaluating them. Admittedly, its a remote possibility, but it
looks like the code in optabs.c really only wants expressions to be
evaluated. As an additional benefit, hoisting the calls to
avoid_constant_pool_reference into optabs.c before the CONSTANT_P
checks should improve initial RTL generation.
Roger
--