Skip to content

Passing of packed structures on sparc64 different than in gcc #39500

Open
@nagisa

Description

@nagisa
Bugzilla Link 40153
Version trunk
OS Linux
CC @glaubitz,@jrtc27,@zygoloid

Extended Description

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 rust-lang/rust#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions