From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CD51F382D384; Mon, 14 Nov 2022 18:50:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD51F382D384 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668451808; bh=0D76qA8uNCSToLwTP0RRe7Nn0bAKx0oEFGfi65C76Hg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Kw7n4dzGa2FWO1q5I0/GIcqwRu3mXs6O7MH1V0RvmFTIzUAraIqZ0/ng3ZbxG95lr Z1mYLTOhFx1zE2EyknFfleDuDc68ySb9qRvwW3+SN7qvRJD5r1Q0jmz2qtAum7G2zw k81XkQf2WcwceNrOX3OjtZo8ODp29agUHK8Vr1qY= From: "carlosgalvezp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107677] -Warray-bounds: unclear what exactly it's meant to detect Date: Mon, 14 Nov 2022 18:50:08 +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: 13.0 X-Bugzilla-Keywords: diagnostic, documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: carlosgalvezp at gmail dot com 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=3D107677 --- Comment #2 from Carlos Galvez --- This is a general question which I hope can be answered without a full repo= rt. My particular example gets a warning deep into Eigen-like code so it's not = easy to provide a minimal example. My questions are code agnostic. Most importantly, I need to understand if t= his warning is expected to produce false positives in it's default setting with -Wall. The documentation says it catches subscripts that are "always" OOB. = This is not the case, as confirmed with other tools. So, is the documentation accurate? Based on your experience with this warning, what type of code is = it expected to warn on? It would be good to add this as part of the documentat= ion. Finally, I ask if the subscript that GCC complains about is real or fiction= al (namely, it "could" be OOB but GCC can't know it statically). We've seen ot= her warnings that complain about fictional numbers representing theoretical wor= st case, for example the max number of an int when unrolling a loop, which is possible in theory but unlikely in practice. Does this warning apply similar heuristics?=