From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A5E013857004; Mon, 12 Sep 2022 07:57:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5E013857004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662969441; bh=p34qzpBTWIf0tpmaBVe+Jq0Cb4b94yfaLP0Ck9uk6ZQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c2/kqrSOuxJo7S/C1u2wjHLMQ+6kzQmPUI2vP18ydrTXvZWOmw1rNIWo4uBrrNejn P5OEge/yHJqf5jOushwsFwqSP6boYzOQBy4eZ8+OmIDJxAoJfpivphO+NTtYjXaBDt Q4k6En0JlomOjqkl68nt7nR8hcH0U143mT2TXOeM= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106901] [13 Regression] False positive -Warray-bounds with -O2 or higher? Date: Mon, 12 Sep 2022 07:57:21 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status short_desc component cf_known_to_work blocked resolution target_milestone 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=3D106901 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Summary|False positive |[13 Regression] False |-Warray-bounds with -O2 or |positive -Warray-bounds |higher? |with -O2 or higher? Component|c++ |tree-optimization Known to work| |12.2.0 Blocks| |56456 Resolution|--- |INVALID Target Milestone|--- |13.0 --- Comment #6 from Richard Biener --- I think this is invalid. We inline bar into foo and see if (size < 5) return false; for (i =3D 5; i < size; ++i) if (vec[i] !=3D 0) .... so we know that vec[5] is accessed when the loop is executed which is out of bounds and we diagnose that. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D56456 [Bug 56456] [meta-bug] bogus/missing -Warray-bounds=