From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51A183853D10; Fri, 21 Jul 2023 21:19:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51A183853D10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689974397; bh=DmzNAhOWmZ1w8zDGk16TxjVQQkjqUeCWWl5I4Wb/fgg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SKOo+x+N7sYvOERPcjbjXFwVACCuSctZe2crgSJB2FVBjZV9xq7UNQetDLpvkvX0w Jxo/Bhctlffhf3eFcWAA0kYe70WBK7Zo4DqaLkLE1vL1jsl/gzu6AZbVaPrCwsh4X9 kJs0aNR/7cVjNU4ZrBawaZPWjeHIo+hSnujK6ijM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110764] [12/13/14 Regression] False positive -Warray-bounds warning swapping std::thread::id Date: Fri, 21 Jul 2023 21:19:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.3.1 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=3D110764 --- Comment #1 from Andrew Pinski --- hmm, this code seems like undefined code. If I change 1 to 2 as you are accessing 2 elements via operator[], there is no warning ... The warning seems correct and even says 1 bounds is above the array bounds = of [1]. The location of the warning seems off but I don't think the warning in this case is false positive though. Maybe it is due to the reduced testcase though.=