This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/52441] SH Target: Double sign/zero extensions for function arguments
- From: "kkojima at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Mar 2012 22:00:14 +0000
- Subject: [Bug target/52441] SH Target: Double sign/zero extensions for function arguments
- Auto-submitted: auto-generated
- References: <bug-52441-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52441
--- Comment #1 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 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.