From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 776E1385843D; Mon, 26 Sep 2022 16:16:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 776E1385843D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664208997; bh=fjjzeB7IPmcsnJ0pOxaXbol1S4onfqTojB6fHrgIgpE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QQeSPF5NWRoE2vk14MB793cq00Fi2PyP2U6kN9QQpVUST1vSpNAUC5Zxt2AvsIn0Q YeB89dnDHdib/EPajbePHc2bhg20FIcbP1gRm3ZSBqgkKIcQaWP9fsRmWRAp5bpaq+ uAsCZH6K5Fgtl0lDuH/m+WyyWLsrMy+VxSY7AtXc= From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107038] [13 Regression] Bogus -Wstringop-overflow= since r13-2789-gb40b3035879cf695 Date: Mon, 26 Sep 2022 16:16:37 +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: msebor 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: 13.0 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=3D107038 --- Comment #3 from Martin Sebor --- Just a quick note from what I see in GDB. The warning is issued by the 2nd= run of the waccess pass (-fdump-tree-waccess2) for the following statement in b= b 22 in pread(): iftmp.21_88 =3D __pread_alias (_50, _82, _81, _79); _81's range reported by range_query::range_of_expr (vr, exp, stmt) is [58, ULONG_MAX], matching the range in the warning. A partial output of debug_ranger() for the function is below. I must be reading it wrong because I don't see what the range above is derived from. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BB 19 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Imports: recvd_78 _83=20=20 Exports: _51 recvd_78 recvd.17_80 _83 _94 _116 _125=20=20 _83 [irange] UNDEFINED [local count: 169058114]: if (_83 =3D=3D 18446744073709551615) goto ; [34.00%] else goto ; [66.00%] 19->22 (T) _83 : [irange] UNDEFINED 19->20 (F) _83 : [irange] UNDEFINED =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BB 20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Imports: _81 _83=20=20 Exports: _81 _83 _85 _86 _87=20=20 _85 : _81(I) _83(I)=20=20 _86 : _81(I) _83(I) _85=20=20 _87 : _81(I) _83(I) _85 _86=20=20 _81 [irange] long unsigned int VARYING _83 [irange] long unsigned int VARYING [local count: 280636469]: _85 =3D _81 <=3D _83; _86 =3D (int) _85; _87 =3D __builtin_constant_p (_86); if (_87 !=3D 0) goto ; [50.00%] else goto ; [50.00%] _86 : [irange] int [0, 1] NONZERO 0x1 _87 : [irange] int [0, 0] NONZERO 0x0 20->21 (T) _81 : [irange] UNDEFINED 20->21 (T) _83 : [irange] UNDEFINED 20->21 (T) _85 : [irange] UNDEFINED 20->21 (T) _86 : [irange] UNDEFINED 20->21 (T) _87 : [irange] UNDEFINED 20->24 (F) _86 : [irange] int [0, 1] NONZERO 0x1 20->24 (F) _87 : [irange] int [0, 0] NONZERO 0x0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BB 21 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Imports: recvd_78 _81 _83=20=20 Exports: _51 recvd_78 recvd.17_80 _81 _83 _94 _116 _125=20=20 _81 [irange] UNDEFINED _83 [irange] UNDEFINED [local count: 140318235]: if (_81 <=3D _83) goto ; [50.00%] else goto ; [50.00%] 21->22 (T) _81 : [irange] UNDEFINED 21->22 (T) _83 : [irange] UNDEFINED 21->23 (F) _81 : [irange] UNDEFINED 21->23 (F) _83 : [irange] UNDEFINED =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BB 22 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [local count: 127638877]: iftmp.21_88 =3D __pread_alias (_50, _82, _81, _79); goto ; [100.00%]=