From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16661 invoked by alias); 6 Feb 2015 20:21:51 -0000 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 Received: (qmail 16533 invoked by uid 48); 6 Feb 2015 20:21:48 -0000 From: "vmakarov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/39723] [4.8/4.9/5 Regression][cond-optab] worse code with long long shifts on v850 Date: Fri, 06 Feb 2015 20:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vmakarov at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: vmakarov at redhat dot com X-Bugzilla-Target-Milestone: 4.8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg00626.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39723 Vladimir Makarov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at gcc dot gnu.org --- Comment #9 from Vladimir Makarov --- (In reply to Jeffrey A. Law from comment #8) Thanks for the investigation, Jeff. Coalescing in IRA is done by register cost propagation. Unfortunately, p46 gets a hard register (12) first, then p53 is processed and it gets reg 10 as p53 occurs in insn 14 involving reg 10. 12: r10:SI=call [r70:SI] argc:0 REG_CALL_DECL `random' 14: {r53:SI=r10:SI&0xf;clobber psw:CC;} REG_DEAD r10:SI REG_UNUSED psw:CC IRA has a propagation cost algorithm from pseudos (through chains of pseudos). This approach was observed as working better than different explicit coalescing algorithms, especially when we have irregular register files and when we are using dynamic register classes in IRA. The propagation algorithm takes conflicting pseudos costs (preferences) into account too. So it is pretty good algorithm. Unfortunately, there is no analogous mechanism for hard registers. If IRA had it, it would propagate preference of p53 (reg 10) to p46 before assigning a hard reg to p46. I am not sure that the PR will be fixed for GCC-5.0 but it would be a good small project for RA to consider in future. Interesting that if p53 were processed first for assigning, we would not have such problem.