From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 83F8D3858D33; Sun, 9 Apr 2023 03:59:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83F8D3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681012792; bh=PsetmjTQJqfpeMUS4eX40p/VvLdk4IZkW98LFDDyOF4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fYGE1yKwZayMfUhVWI2U1MFhaCCs8B1f+1clRWGCLHxqwrR7o37+DPDUvAQWQW1sK UeprJhwy1PKYx76Wt/HblZTH29+pUsInl4+WDOyc89mOrYfWsm787oexXWF1UNCVQD 9nZkotGoRHOxdkgQgIYO+Ygw8lQZJ3UmQ8VB1tGY= From: "christian.prochaska@genode-labs.com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: christian.prochaska@genode-labs.com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.3 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=3D104288 Christian Prochaska changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |christian.prochaska@genode- | |labs.com --- Comment #13 from Christian Prochaska --- I found the "Register non-null side effects properly." commit with git bise= ct 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 commi= t is now not present anymore. The C++ code with the null pointer check can be fo= und on GitHub: https://github.com/genodelabs/genode/blob/a84af9a9606450471b8038a35f9b55057= efa0850/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/a84af9a9606450471b8038a35f9b55057= efa0850/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 =3D 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