From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C94FF3858D3C; Wed, 1 Feb 2023 12:40:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C94FF3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675255258; bh=ymdDD474spXUbj4qa1i09vhjHBuQNX4p4Iy9tmJiMvk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=minPx0WXJTSVxRUendHxf8mV74eEfKC7ltHk/G9C44abVGGuoJ9zHPRrizzjGE9ee Yhl1ZuQzu3UrliKPAw7JFJNkdJStV9OLyIjPvCOJG5HXhzcAOZMwMJn8wMmGbBMnAs tx2WQFJMnZnXiQ7ZvASsMUWcGNZTROCxh4Ci1Xbk= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108517] [11/12/13 Regression] std::sort of empty range yield "warning: 'this' pointer is null" Date: Wed, 01 Feb 2023 12:40:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D108517 --- Comment #7 from Jakub Jelinek --- Or perhaps when considering the constprop see that for __first_5(D) being 0B there would be pointer arithmetics on NULL (the __first_5(D) p+ 16) and so would invoke UB or likely invoke UB and so not worth constant propagation.=