From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10100 invoked by alias); 12 Oct 2013 21:26:20 -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 10045 invoked by uid 48); 12 Oct 2013 21:26:17 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/51244] [SH] Inefficient conditional branch and code around T bit Date: Sat, 12 Oct 2013 21:26: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.7.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: olegendo at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2013-10/txt/msg00699.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51244 --- Comment #71 from Oleg Endo --- (In reply to Oleg Endo from comment #70) > Author: olegendo > Date: Sat Oct 12 20:47:22 2013 > New Revision: 203492 > The issue raised in comment #59 has been fixed on 4.9. There are some open issues though, which I will try to address in follow up patches: * The helper functions in sh_treg_combine.cc should go into a separate .h + .cc file. This would allow re-using them in other places and eliminate the similar function 'sh_find_set_of_reg' in sh.c * The RTL pass does the treg combine only when there is a conditional branch. It should also handle conditional move insns (-mpretend-cmove). * The function 'try_combine_comparisons' in sh_reg_combine.cc always introduces reg-reg copies. In some cases (DImode comparisons in particular), these reg-reg moves don't get eliminated afterwards before register allocation. The function should check whether creating new pseudos can be avoided by re-using existing regs. The sh_treg_combine RTL pass could probably be backported to 4.8 but seems too intrusive. Instead something like the patch in comment #64 should do, where instead of checking for 'no_labels_between_p' it would probably be better to check if the basic block with the conditional branch has only one predecessor.