From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C80773858C1F; Thu, 13 Jul 2023 08:25:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C80773858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689236744; bh=PfLrlt2Cq+UlNR7Qxl23E8Ta6tDkr48sE0gVLGbltcY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fmWtF5l63t9y66TbGO0mHW4+sWYvkoXWc7yXg/IHKDZ+/K44L36/wLaWRoaZgYNO8 qSz3eMnFjA2V22liVOnrtFBKpaTfSo3mBm1RBRYBlT2sZ9RT9r/O52Vu+snUUAYoTe J/vWNJ8UauRmuRuSOIrKeFuQGFHV50RWEPOyvJmo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110645] False positive -Warray-bounds warning Date: Thu, 13 Jul 2023 08:25:32 +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.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cf_reconfirmed_on version cf_known_to_work bug_status cf_known_to_fail 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=3D110645 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2023-07-13 Version|unknown |13.2.1 Known to work| |10.5.0 Status|UNCONFIRMED |NEW Known to fail| |11.3.0, 14.0 --- Comment #1 from Richard Biener --- Confirmed. Emitted from #0 warning_at (location=3D2147483699, opt=3D507,=20 gmsgid=3D0x3360cb8 "%qD forming offset %s is out of the bounds [0, %wu]= ") at /space/rguenther/src/gcc/gcc/diagnostic.cc:1903 #1 0x0000000001215eb1 in (anonymous namespace)::maybe_diag_access_bounds ( call=3D, func=3D, strict=3D0, ref=3D...,=20 wroff=3D..., do_warn=3Dtrue) at /space/rguenther/src/gcc/gcc/gimple-ssa-warn-restrict.cc:1834 #2 0x00000000012168cf in check_bounds_or_overlap (ptrqry=3D..., call=3D,=20 dst=3D, src=3D,= =20 dstsize=3D, srcsize=3D, bounds_onl= y=3Dfalse, do_warn=3Dtrue) at /space/rguenther/src/gcc/gcc/gimple-ssa-warn-restrict.cc:2043 #3 0x0000000001216643 in (anonymous namespace)::pass_wrestrict::check_call (this=3D0x4432a00,=20 call=3D) at /space/rguenther/src/gcc/gcc/gimple-ssa-warn-restrict.cc:1989 #4 0x000000000120ef00 in (anonymous namespace)::pass_wrestrict::check_block (this=3D0x4432a00,=20 bb=3D) at /space/rguenther/src/gcc/gcc/gimple-ssa-warn-restrict.cc:100 #5 0x000000000120ef78 in (anonymous namespace)::pass_wrestrict::execute (this=3D0x4432a00,=20 fun=3D0x7ffff739b0b8) at /space/rguenther/src/gcc/gcc/gimple-ssa-warn-restrict.cc:112 #6 0x0000000001518413 in execute_one_pass (pass=3D) at /space/rguenther/src/gcc/gcc/passes.cc:2651 on the path where strlen (inStr) > 254: [local count: 1073741824]: _1 =3D strlen (inStr_3(D)); if (_1 <=3D 254) goto ; [50.00%] else goto ; [50.00%] $2 =3D (gdb) p debug_bb_n (4) [local count: 536870913]: _10 =3D _1 + 4; att_11 =3D palloc (_10); _12 =3D (unsigned int) _1; att_11->len =3D _12; _13 =3D &att_11->data; memcpy (_13, inStr_3(D), _1); it looks like we are confused - not sure how though.=