From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A94D385840D; Thu, 3 Mar 2022 21:20:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A94D385840D From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104746] False positive for -Wformat-overflow=2 since r12-7033-g3c9f762ad02f398c Date: Thu, 03 Mar 2022 21:20:55 +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: 12.0 X-Bugzilla-Keywords: diagnostic, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com 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: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2022 21:20:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104746 Andrew Macleod changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amacleod at redhat dot com --- Comment #7 from Andrew Macleod --- (In reply to Martin Sebor from comment #6) > None of these "false positives" is due to a bug in the warning code. The > warning has been designed and documented to work this way. What triggers > more instances of these warnings in GCC 12 is the more accurate range info > courtesy of Ranger. Prior to GCC 12, the ranges were less accurate and > sometimes unavailable at all, and the warning is designed to avoid > triggering in the absence of any range info at all. >=20 > So I don't consider this a regression. "Regression" is defined as didn't cause a problem before, but does now. Mak= ing this a regression. Besides, according to the warning: size 4 [-Wformat-overflow=3D] 8 | __builtin_sprintf (a, "%u%u", i, j); | ^~ b.c:8:25: note: using the range [0, 4294967295] for directive argument 8 | __builtin_sprintf (a, "%u%u", i, j); | ^~~~~~ b.c:8:25: note: using the range [0, 4294967295] for directive argument b.c:8:3: note: =E2=80=98__builtin_sprintf=E2=80=99 output between 3 and 21 = bytes into a destination of size 4 8 | __builtin_sprintf (a, "%u%u", i, j); its using [0, 4294967295] as the range, which is [0, 0xFFFFFFFF] or varying= .. so there isn't any new precision of ranges from ranger causing this? TVRYING implies there is no range at all known. Wouldnt we be seeing [0,9] if you were getting more precise ranges?=