From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21989 invoked by alias); 1 Mar 2012 22:00:39 -0000 Received: (qmail 21977 invoked by uid 22791); 1 Mar 2012 22:00:37 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Thu, 01 Mar 2012 22:00:19 +0000 From: "kkojima at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/52441] SH Target: Double sign/zero extensions for function arguments Date: Thu, 01 Mar 2012 22:00: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kkojima 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-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: 2012-03/txt/msg00166.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52441 --- Comment #1 from Kazumoto Kojima 2012-03-01 22:00:14 UTC --- (In reply to comment #0) > The sign/zero extensions in the caller (_xx) are not emitted when using the > original Renesas ABI (-mrenesas), which is correct. Correct for efficiency, but not for robustness :-) > Maybe this double sign/zero extension has some historical reason for some ABI > backwards compatibilities in the GNU SH ABI... but shouldn't it actually be > safe to leave out the sign/zero extensions on one side of the function call > (either caller or callee)? I don't know any historical reason but x86 uses that double sign/zero extension too. It wouldn't be a safe ABI change. There can exist hand written functions depending that behavior. It's too late to change the default behavior, I think. Of course, you can add a new -m option or function attribute changing it, though it shouldn't be default for non Renesas ABI.