This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
--



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]