From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3267 invoked by alias); 17 Aug 2011 22:21:31 -0000 Received: (qmail 3257 invoked by uid 22791); 17 Aug 2011 22:21:30 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_DC,TW_DD,TW_OV X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Aug 2011 22:21:17 +0000 From: "vmakarov at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/50107] [IRA, i386] allocates regiters in very non-optimal way Date: Wed, 17 Aug 2011 22:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: vmakarov at redhat dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-08/txt/msg01537.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50107 --- Comment #6 from Vladimir Makarov 2011-08-17 22:21:13 UTC --- (In reply to comment #4) > Created attachment 25038 [details] > A patch > > This patch generates: > > movq %rdi, %rdx > mulx %rsi, %r10, %r9 > addq $3, %r9 > adcq $0, %r10 > movq %r9, k2(%rip) > movq %r9, %rax > movq %r10, k2+8(%rip) > movq %r10, %rdx > ret I don't think it is a good patch (changing register allocation order) because it prefers new x86-64 registers and results in longer insns and bigger code for many programs. I am working on a patch to fix it in IRA. I found a typo which is a reason for such behaviour. I think it will be ready tomorrow.