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] fix non-canonical RTL produced by expand


Paolo Bonzini wrote:

* optabs.c (expand_binop): Use best_order_for_commutative_binop_p
to order operands.
(best_order_for_commutative_binop_p): New.


You should have gone with the name I gave you.  This name is exactly
wrong -- it returns true when the order given is in fact *not* best.


I see. I'll switch it.

Sorry for hitting send too early. Here is the patch.

David Edelsohn reported that this patches causes a 3-5% regression on gap, because it causes cases like (plus (mem) (reg)) to be kept as they are, instead of being canonicalized to (plus (reg) (mem)).


Considering that we are in stage3, that the change was more destabilizing than expected, and that the patch was only (trying to) fix a latent bug, I'll revert the patch in 24 hours unless somebody asks me to do it earlier. :-)

David also suggested a solution, that is distinguishing REGs from other objects in commutative_operand_precedence. But that's even more dangerous so I'll investigate it for 4.2.

Paolo


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