From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 86CB73858C5F; Mon, 18 Mar 2024 20:39:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86CB73858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710794341; bh=Xd9otHww5r9uz1KmxpIqiLIFO3HRHHV8Th+GIWb+kbw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ELQqgiGe5lZJbLOIMoz0mJ/gBsBU0s6UiBMsaFUFEHl+yVR+Yhqxo8qe8SsjrbSEU kLN61sdj5vyFww379yfWL7j91EH+Zx4ZGynkmmN27XV0WiKcsqqb6PNOVl/1/+bpQk 3e/noJ8uYIH8Koswte1aVm0NO/bLiYdza9iL9j4c= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114385] -Wrestrict false positive creating std::string from iterators Date: Mon, 18 Mar 2024 20:39:01 +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: 13.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D114385 --- Comment #1 from Andrew Pinski --- Another workaround is to add: if (end-begin < 0) __builtin_unreachable(); I notice that this is not the same as: [[assume(end-begin >=3D 0)]]; but that seems related to another bug report dealing with how we don't do IPA_SRA over assume statements yet.=