public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103964] [9/10/11/12 Regression] OVS miscompilation since r0-92313-g5006671f1aaa63cd
Date: Tue, 11 Jan 2022 14:06:46 +0000 [thread overview]
Message-ID: <bug-103964-4-ZOwIKSb6Ti@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103964-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103964
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Ilya Maximets from comment #7)
> One thing that is not clear to me is if the following code has an UB or not:
>
> struct member* pos;
> struct ovs_list start;
>
> pos = (struct member *)(void*)((uintptr_t)(&start) - 64);
> ovs_list_insert((void *)((uintptr_t)pos + 64), &member->elem);
>
> ?
>
> This code works fine. Basically, the question is: can we cast and store
> the random (aligned) integer to a pointer type, if we're not going to
> perform any kind of pointer arithmetic (using the integer arithmetic for
> the ovs_list_insert) nor dereference it, unless it points to the actual
> valid object?
That should be OK, yes.
next prev parent reply other threads:[~2022-01-11 14:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 15:12 [Bug tree-optimization/103964] New: " jakub at gcc dot gnu.org
2022-01-10 15:18 ` [Bug tree-optimization/103964] " fw at gcc dot gnu.org
2022-01-10 15:58 ` jakub at gcc dot gnu.org
2022-01-11 2:52 ` pinskia at gcc dot gnu.org
2022-01-11 8:15 ` rguenth at gcc dot gnu.org
2022-01-11 8:38 ` rguenth at gcc dot gnu.org
2022-01-11 11:19 ` i.maximets at ovn dot org
2022-01-11 12:11 ` jakub at gcc dot gnu.org
2022-01-11 13:58 ` i.maximets at ovn dot org
2022-01-11 14:06 ` rguenth at gcc dot gnu.org [this message]
2022-01-11 14:47 ` jakub at gcc dot gnu.org
2022-01-11 16:46 ` i.maximets at ovn dot org
2022-01-11 17:00 ` jakub at gcc dot gnu.org
2022-01-11 17:10 ` i.maximets at ovn dot org
2022-01-11 17:57 ` jakub 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-103964-4-ZOwIKSb6Ti@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).