From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7157 invoked by alias); 19 Oct 2014 02:34:45 -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 7076 invoked by uid 48); 19 Oct 2014 02:34:33 -0000 From: "kkojima at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/55212] [SH] Switch to LRA Date: Sun, 19 Oct 2014 02:34: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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kkojima at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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: 2014-10/txt/msg01457.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212 --- Comment #69 from Kazumoto Kojima --- The patch in c#57 disables memory equiv substitution for the memory with base+index and base+display addressing. static bool sh_cannot_substitute_equiv_p (rtx subst) { if (TARGET_SHMEDIA) return false; if (GET_CODE (subst) == SUBREG) subst = SUBREG_REG (subst); if (MEM_P (subst) && GET_CODE (XEXP (subst, 0)) == PLUS) return true; return false; } A bit surprisingly, disabling all memory equiv substitution wins CSiBE tests. With static bool sh_cannot_substitute_equiv_p (rtx subst) { if (TARGET_SHMEDIA) return false; return true; } the code size regression for CSiBE from non LRA is reduced to 0.59%. Looking at the improved cases, the extra save/restore insns to/from stack disappear. I guess that SH has not enough numbers of the hard registers to make the equiv substitution win in the size and the speed on average working sets. It looks the pseudos produced to hold the equiv values can't get hard registers for bad cases and end up memory save/restore insns which make the code worse.