From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D1873858D20; Fri, 31 Mar 2023 06:35:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D1873858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680244538; bh=JTHzSKZko0vSlREFWdM9fnDSWK9kmYDsaDqUnnoqRpQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JYVT4KnAlUAOV6MOZNiwppNyLYE/6oWfYmqS6dQn+2YTrpFpmY1+qPXD/MMi9N2TM qp6xHrTAVLSg2pyHNQ/MgSLtqNxdyF2gn+iWTpEAV2KB/fj7nnvqHfl2KoxFs9Fa/d BmXIzIKC8+uZ0vP8/GUb4Fx0qjIj9xfFE0Nx2ML4= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109350] FAIL: g++.dg/warn/Wstringop-overflow-4.C Date: Fri, 31 Mar 2023 06:35:38 +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: rguenth 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: keywords blocked 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=3D109350 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Blocks| |88443 --- Comment #1 from Richard Biener --- We have [local count: 1073741824]: _28 =3D{v} signed_value_source; _4 =3D (unsigned long) _28; _9 =3D _4 + 2147483648; if (_9 > 4294967295) goto ; [50.00%] else goto ; [50.00%] [local count: 536870913]: r_imin_imax_8 =3D (int) _28; _31 =3D r_imin_imax_8 + 1; _29 =3D (sizetype) _31; if (_4 <=3D 4611686018427387900) goto ; [50.00%] else goto ; [50.00%] [local count: 268435458]: _13 =3D operator new [] (18446744073709551615); __builtin_memcpy (_13, &MEM [(void *)"0123456789abcdefghijklmnopqrstuvwxyz" + 35B], 2); sink (_13); if (_29 <=3D 4611686018427387900) goto ; [100.00%] else goto ; [0.00%] [local count: 0]: iftmp.1_38 =3D _29 * 2; _40 =3D operator new [] (iftmp.1_38); __builtin_memcpy (_40, &MEM [(void *)"0123456789abcdefghijklmnopqrstuvwxyz" + 34B], 3); and we're again down into get_size_range of the operator new[] argument iftmp.1_38: pointer-query.cc:507 /* Determine the largest valid range size, including zero. */ if (!get_size_range (qry, size, stmt, r, SR_ALLOW_ZERO | SR_USE_LARGEST= )) return NULL_TREE; where we compute [irange] long unsigned int [0, 0] NONZERO 0x0$27 =3D void for the range. I have to make up my mind if that's correct, but ranger debug prints the same conclusion so it doesn't seem to be an artifact of using legacy value_range. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D88443 [Bug 88443] [meta-bug] bogus/missing -Wstringop-overflow warnings=