From: Jeff Law <jeffreyalaw@gmail.com>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Vineet Gupta <vineetg@rivosinc.com>,
gcc-patches@gcc.gnu.org, gnu-toolchain@rivosinc.com
Subject: Re: [PATCH] RISC-V: fix TARGET_PROMOTE_FUNCTION_MODE hook for libcalls
Date: Tue, 31 Oct 2023 18:51:39 -0600 [thread overview]
Message-ID: <4f1c8ccd-1232-43aa-a289-1717bc4d0fef@gmail.com> (raw)
In-Reply-To: <mhng-327bc33a-9fc0-4d47-bb4b-4970d04175a1@palmer-ri-x1c9>
On 10/31/23 17:41, Palmer Dabbelt wrote:
> On Tue, 31 Oct 2023 16:18:35 PDT (-0700), jeffreyalaw@gmail.com wrote:
>>
>>
>> On 10/31/23 12:35, Vineet Gupta wrote:
>>> riscv_promote_function_mode doesn't promote a SI to DI for libcalls
>>> case.
>>>
>>> The fix is what generic promote_mode () in explow.cc does. I really
>>> don't understand why the old code didn't work, but stepping thru the
>>> debugger shows old code didn't and fixed does.
>>>
>>> This showed up when testing Ajit's REE ABI extension series which probes
>>> the ABI (using a NULL tree type) and ends up hitting the libcall code
>>> path.
>>>
>>> [Usual caveat, I'll wait for Pre-commit CI to run the tests and report]
>>>
>>> gcc/ChangeLog:
>>> * config/riscv/riscv.cc (riscv_promote_function_mode): Fix mode
>>> returned for libcall case.
>> Hmm. There may be dragons in here. I'll need to find and review an old
>> conversation in this space (libcalls and argument promotions).
>
> We also have a non-orthogonality in the ABI sign extension rules between
> SI and DI, a few of us were talking about it on the internal slack
> (though the specifics were for a different patch, Vineet has a few in
> flight).
So the old issue I was thinking of really only affects targets that push
arguments on the stack and when a sub-word push actually allocates a
full word on the stack (m68k, but !coldfire, h8 and probably others of
that era).
Point being, those issues don't apply here.
jeff
next prev parent reply other threads:[~2023-11-01 0:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 18:35 Vineet Gupta
2023-10-31 23:18 ` Jeff Law
2023-10-31 23:41 ` Palmer Dabbelt
2023-11-01 0:51 ` Jeff Law [this message]
2023-11-01 1:37 ` Vineet Gupta
2023-11-01 19:11 ` Jeff Law
2023-11-01 19:19 ` Vineet Gupta
2023-11-01 21:24 ` Patrick O'Neill
2023-11-01 21:51 ` [[Committed]] " Vineet Gupta
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=4f1c8ccd-1232-43aa-a289-1717bc4d0fef@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gnu-toolchain@rivosinc.com \
--cc=palmer@dabbelt.com \
--cc=vineetg@rivosinc.com \
/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).