From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9B9673858407; Wed, 27 Mar 2024 09:49:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B9673858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711532978; bh=djmuLBWIcxcPFoIVqn5uALmQ31SIH2scVsng/CjRC1Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ulHwf8I57zQ+5jnc4i0TWMfN6GD4lh1A+d445ZITS2KlWKgK6uiL0+i3k/xdtuZIZ LPY5rP82TiAPFNgwRUNHuzAMt1VjhnjtTQHdoC8A0T4XYJhWGNgmXdypidcr98fYCq RAaIGwwZKGt9sG4ZyDwFbZ4W8ra2EvsOsgQbhFO8= From: "jakub.kulik at oracle dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub.kulik at oracle dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114416 Jakub Kulik changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub.kulik at oracle dot = com --- Comment #6 from Jakub Kulik --- Thank you for the proposed fix! I tested it with several programs that I us= ed to find/reproduce the issue and it seems to work now (I talked about this w= ith Rainer initially). As for the ABI being potentially unclear, I am in no way a SPARCv9 ABI expe= rt, 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 a= re 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 returne= d in registers. The registers are assigned as if the value was being passed as t= he 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 regis= ters based on their type using the same rules as apply to scalar values* (with t= he addition that a single-precision floating-point number assigned to the left half of an argument slot will be promoted into the corresponding even-numbe= red float register.)." [sic; emphasis added.]=20 """=