[Pkg-rust-maintainers] Bug#904703: rustc: Please backport another sparc64 CABI fix

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Thu Jul 26 22:51:03 BST 2018


Source: rustc
Version: 1.27.2+dfsg1-1
Severity: normal
Tags: patch
User: debian-sparc at lists.debian.org
Usertags: sparc64

Hello!

Rust upstream just fixed another bug in the sparc64 CABI [1]
which can result in miscompiled code. Since the patch is rather
trivial and affects sparc64 only, it would be good if we could
include it in the next upload.

Attaching the patch from upstream.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
-------------- next part --------------
>From 051eddd9a9067dcbdccef6bfd86301453bae42ad Mon Sep 17 00:00:00 2001
From: Petr Sumbera <petr.sumbera at oracle.com>
Date: Thu, 26 Jul 2018 03:58:00 -0700
Subject: [PATCH] sparc ABI issue - structure returning from function is
 returned in 64bit registers

Fixes: #52638
---
 src/librustc_target/abi/call/sparc64.rs | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/librustc_target/abi/call/sparc64.rs b/src/librustc_target/abi/call/sparc64.rs
index 987f56e6f985..a58aebc2ff06 100644
--- a/src/librustc_target/abi/call/sparc64.rs
+++ b/src/librustc_target/abi/call/sparc64.rs
@@ -57,16 +57,7 @@ fn classify_ret_ty<'a, Ty, C>(cx: C, ret: &mut ArgType<'a, Ty>)
     let size = ret.layout.size;
     let bits = size.bits();
     if bits <= 256 {
-        let unit = if bits <= 8 {
-            Reg::i8()
-        } else if bits <= 16 {
-            Reg::i16()
-        } else if bits <= 32 {
-            Reg::i32()
-        } else {
-            Reg::i64()
-        };
-
+        let unit = Reg::i64();
         ret.cast_to(Uniform {
             unit,
             total: size



More information about the Pkg-rust-maintainers mailing list