public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub.kulik at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/114416] calling convention incompatibility with vendor compiler for V9
Date: Wed, 27 Mar 2024 09:49:37 +0000	[thread overview]
Message-ID: <bug-114416-4-bO7J3ntvLw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114416-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114416

Jakub Kulik <jakub.kulik at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub.kulik at oracle dot com

--- Comment #6 from Jakub Kulik <jakub.kulik at oracle dot com> ---
Thank you for the proposed fix! I tested it with several programs that I used
to find/reproduce the issue and it seems to work now (I talked about this with
Rainer initially).

As for the ABI being potentially unclear, I am in no way a SPARCv9 ABI expert,
so I asked internally, and was told that the ABI should be clear about this
case:

"""
See page 3P-10 (PDF page 46) where it says this:

%f0,%f1,%f2,%f3
(%d0, %d2)
(%q0)
Floating-point return values appear in the floating-point registers.
Single-precision values occupy %f0; double-precision values occupy %d0;
quad-precision values occupy %q0. (Refer to the SPARCTM Architecture Manual,
Version 9 for details on the register numbering scheme). Otherwise, these are
scratch registers.

and

%f0 through %f7
(%d0 through %d6)
(%q0 and %q4)
Floating-point fields from structure return values with a total size of 32
bytes or less appear in the floating-point registers.

Then on page 3P-13 (PDF page 49) it says this:
Structure or Union return values
Structure and union return types up to thirty-two bytes in size are returned in
registers. The registers are assigned as if the value was being passed as the
first argument to a function with a known prototype.

So we have to refer back to "Structure and Union arguments" on page 3P-12 (PDF
page 48) where it says:

"Structure or union types are always left-justified, whether stored in
registers or memory. *The individual fields of a structure (or containing
storage unit in the case of bit fields) are subject to promotion into registers
based on their type using the same rules as apply to scalar values* (with the
addition that a single-precision floating-point number assigned to the left
half of an argument slot will be promoted into the corresponding even-numbered
float register.)." [sic; emphasis added.] 
"""

  parent reply	other threads:[~2024-03-27  9:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 13:00 [Bug target/114416] New: SPARC V9 struct return with floating-point members violates ABI ro at gcc dot gnu.org
2024-03-21 13:00 ` [Bug target/114416] " ro at gcc dot gnu.org
2024-03-21 13:01 ` ro at gcc dot gnu.org
2024-03-21 14:54 ` ebotcazou at gcc dot gnu.org
2024-03-21 15:08 ` ro at CeBiTec dot Uni-Bielefeld.DE
2024-03-24 10:42 ` ebotcazou at gcc dot gnu.org
2024-03-25  9:02 ` [Bug target/114416] calling convention incompatibility with vendor compiler for V9 ebotcazou at gcc dot gnu.org
2024-03-27  9:49 ` jakub.kulik at oracle dot com [this message]
2024-03-27  9:56 ` jakub.kulik at oracle dot com
2024-03-27 10:13 ` ebotcazou at gcc dot gnu.org
2024-03-27 10:16 ` ebotcazou at gcc dot gnu.org
2024-04-17 14:06 ` jakub.kulik at oracle dot com
2024-04-17 14:08 ` jakub.kulik at oracle dot com
2024-04-23  8:31 ` ebotcazou at gcc dot gnu.org
2024-04-23 11:34 ` ro at CeBiTec dot Uni-Bielefeld.DE
2024-04-24  7:26 ` ebotcazou at gcc dot gnu.org
2024-04-24  7:31 ` ro at CeBiTec dot Uni-Bielefeld.DE
2024-04-24 12:17 ` ro at CeBiTec dot Uni-Bielefeld.DE
2024-04-24 12:29 ` ebotcazou at gcc dot gnu.org
2024-04-24 12:34 ` ro at CeBiTec dot Uni-Bielefeld.DE
2024-04-25  9:29 ` ro at CeBiTec dot Uni-Bielefeld.DE
2024-04-25 10:48 ` cvs-commit at gcc dot gnu.org
2024-04-25 10:56 ` ebotcazou at gcc dot gnu.org
2024-04-25 11:01 ` jakub.kulik at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114416-4-bO7J3ntvLw@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).