public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "acoplan at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/107238] New: aarch64: Wrong code converting pointer to __int128
Date: Wed, 12 Oct 2022 16:25:37 +0000 [thread overview]
Message-ID: <bug-107238-4@http.gcc.gnu.org/bugzilla/> (raw)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107238
Bug ID: 107238
Summary: aarch64: Wrong code converting pointer to __int128
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: acoplan at gcc dot gnu.org
Target Milestone: ---
For this testcase:
__int128 f(int *p) {
return (__int128)p;
}
AArch64 GCC at -O2 generates:
f:
asr x1, x0, 63
ret
i.e. it sign-extends the pointer, but I think it should be a zero extend
instead. The ABI [1] says:
> Code and data pointers are either 64-bit or 32-bit unsigned types.
Indeed LLVM does a zero-extend:
f: // @f
mov x1, xzr
ret
[1] :
https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#pointers
next reply other threads:[~2022-10-12 16:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 16:25 acoplan at gcc dot gnu.org [this message]
2022-10-12 23:21 ` [Bug target/107238] " pinskia at gcc dot gnu.org
2022-10-12 23:25 ` pinskia at gcc dot gnu.org
2022-10-13 0:12 ` pinskia at gcc dot gnu.org
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-107238-4@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).