From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14471 invoked by alias); 19 Dec 2007 13:36:17 -0000 Received: (qmail 14430 invoked by uid 48); 19 Dec 2007 13:36:02 -0000 Date: Wed, 19 Dec 2007 13:36:00 -0000 Message-ID: <20071219133602.14429.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/17236] inefficient code for long long multiply on x86 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bonzini at gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg01812.txt.bz2 ------- Comment #23 from bonzini at gnu dot org 2007-12-19 13:36 ------- Created an attachment (id=14794) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14794&action=view) teach combine that reg = op(reg, mem) is better Since combine operates on the whole pattern, it can be taught the trick that swap_commutative_operands_with_target does in optabs.c. This is the "right way" to do the hack Uros proposed in comment #18. Note that optabs.c does not get it because it creates reg=subreg*subreg. Then CSE creates SImode memory loads from the subreg, and combine creates reg=mem*reg. With this patch, combine creates reg=reg*mem instead. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17236