[llvm-bugs] [Bug 40153] New: Passing of packed structures on sparc64 different than in gcc

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 25 03:35:08 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=40153

            Bug ID: 40153
           Summary: Passing of packed structures on sparc64 different than
                    in gcc
           Product: clang
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: simonas+llvm.org at kazlauskas.me
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

This bug has been originally discovered by Michael Karcher. Filling the bug on
behalf of them.

---

As noted while filing a bug on rustc because rustc does not correctly implement
the Sparc64 ABI regarding floating point fields of "small" structures, I
stumbled across a difference between gcc an clang, as shown in
https://github.com/rust-lang/rust/issues/57103 (the important piece is quoted
below):

struct str3 {
  float f;  // passed in most-significant half of %o0 (gcc) or in %f0 (clang)
  int i;    // passed in least-significant half of %o0
} __attribute__((packed));

Without __attribute__((packed)), clang, gcc and the ABI standard agree to pass
f in %f0. The ABI standard doesn't contain anything about packed structures, so
I don't see a way to decide whether gcc or clang is right. I report a bug on
both products to raise awareness.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181225/d291e6e6/attachment.html>


More information about the llvm-bugs mailing list