public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "christian.prochaska@genode-labs.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/104288] [11/12 Regression] EVRP null pointer check removal for strcmp (and maybe others) is not flow senative
Date: Sun, 09 Apr 2023 03:59:50 +0000	[thread overview]
Message-ID: <bug-104288-4-ec2VtF03Ds@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104288-4@http.gcc.gnu.org/bugzilla/>

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

Christian Prochaska <christian.prochaska@genode-labs.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |christian.prochaska@genode-
                   |                            |labs.com

--- Comment #13 from Christian Prochaska <christian.prochaska@genode-labs.com> ---
I found the "Register non-null side effects properly." commit with git bisect
while debugging a page fault in the Genode OS framework built with GCC 12.2.0.
It turned out that a null pointer check which was present before this commit is
now not present anymore. The C++ code with the null pointer check can be found
on GitHub:

https://github.com/genodelabs/genode/blob/a84af9a9606450471b8038a35f9b55057efa0850/repos/base-nova/src/lib/base/ipc.cc#L71

This is the implementation of the 'Thread::myself()' function which returns a
null pointer in some conditions:

https://github.com/genodelabs/genode/blob/a84af9a9606450471b8038a35f9b55057efa0850/repos/base/src/lib/base/thread_myself.cc#L22

I compared the disassembled code from objdump and this part is missing when the
commit is applied:

Genode::ipc_call(Genode::Native_capability, Genode::Msgbuf_base&,
Genode::Msgbuf_base&, unsigned long):
/.../repos/base-nova/src/lib/base/ipc.cc:71
    addr_t const manual_rcv_sel = myself ?
myself->native_thread().client_rcv_sel
   85f78:   48 83 bd 50 ff ff ff    cmpq   $0x0,-0xb0(%rbp)
   85f7f:   00
   85f80:   48 c7 c3 ff ff ff ff    mov    $0xffffffffffffffff,%rbx
   85f87:   74 1d                   je     85fa6
<Genode::ipc_call(Genode::Native_capability, Genode::Msgbuf_base&,
Genode::Msgbuf_base&, unsigned long)
/.../repos/base-nova/src/lib/base/ipc.cc:71 (discriminator 1)

Now I'm not sure if the problem is in the Genode code or in GCC. Any ideas?

  parent reply	other threads:[~2023-04-09  3:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30 10:09 [Bug c/104288] New: Null pointer check invalidly deleted nrk at disroot dot org
2022-01-30 10:26 ` [Bug middle-end/104288] [11/12 Regression] " pinskia at gcc dot gnu.org
2022-01-30 10:29 ` [Bug tree-optimization/104288] [11/12 Regression] EVRP null pointer check removal for strcmp (and maybe others) is not flow senative pinskia at gcc dot gnu.org
2022-01-30 11:03 ` jakub at gcc dot gnu.org
2022-01-31  8:21 ` rguenth at gcc dot gnu.org
2022-01-31 14:53 ` amacleod at redhat dot com
2022-01-31 15:34 ` jakub at gcc dot gnu.org
2022-01-31 22:39 ` amacleod at redhat dot com
2022-02-01  8:04 ` rguenther at suse dot de
2022-02-02 21:52 ` amacleod at redhat dot com
2022-02-08 15:03 ` cvs-commit at gcc dot gnu.org
2022-02-09 14:10 ` cvs-commit at gcc dot gnu.org
2022-02-09 14:11 ` amacleod at redhat dot com
2023-04-09  3:59 ` christian.prochaska@genode-labs.com [this message]
2023-04-09  4:12 ` pinskia at gcc dot gnu.org
2023-04-09  4:12 ` pinskia at gcc dot gnu.org
2023-04-09  7:07 ` christian.prochaska@genode-labs.com
2023-04-09  7:43 ` 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-104288-4-ec2VtF03Ds@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).