From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19320 invoked by alias); 15 Oct 2014 13:45:15 -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 18849 invoked by uid 48); 15 Oct 2014 13:45:06 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/59401] [SH] GBR addressing mode optimization produces wrong code Date: Wed, 15 Oct 2014 13:45: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: attachments.created 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/msg01149.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59401 --- Comment #11 from Oleg Endo --- Created attachment 33723 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33723&action=edit Make GBR call preserved by default (In reply to Oleg Endo from comment #10) > (In reply to Kazumoto Kojima from comment #9) > > (In reply to Oleg Endo from comment #8) > > > change the > > > value for gbr in sh.h CALL_USED_REGISTERS from '1' to '0' and confirm that > > > everything is still OK? > > > > The comment and document about CALL_USED_REGISTERS say that it must be > > a superset of FIXED_REGISTERS. CALL_REALLY_USED_REGISTERS might be > > a macro for that purpose. > > Right. In this case it's probably better to do it in > sh_conditional_register_usage. It would be nice if '-fcall-saved-gbr' and > '-fcall-used-gbr' still remained functional afterwards ... I'll give it a > try. sh_conditional_register_usage is invoked after the -fcall-*-* options are processed. Defining the CALL_REALLY_USED_REGISTERS macro with the default values works as expected, i.e. -fcall-used-gbr still works. Kaz, could you please add the attached patch to your test run?