From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F384C3858C56; Mon, 12 Feb 2024 10:23:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F384C3858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707733405; bh=zV2chlm6wxJBd4DZ/74E/pts/LuzA2twkRnRyVYyMa8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aDkLGJvbIJlZoX4k6QmoO+XYtl8/WfnVU9iLznz/J7CIju9wFhcn1mZD744/B7ood Jy621CwsMO/OoBqwIey2ce9Xulf/QzD+Wkx8aCLhC8SpJqn7QPP0UqY5uq32Rv/UcP cqn6YoRw2/BYWan/z5iBGVI7eTfdqg7MVXh39C+k= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyB0cmVlLW9wdGltaXphdGlvbi8xMTM3NTJdIFsxNCBSZWdy?= =?UTF-8?B?ZXNzaW9uXSB3YXJuaW5nOiDigJglc+KAmSBkaXJlY3RpdmUgd3JpdGluZyB1?= =?UTF-8?B?cCB0byAxMDIxOCBieXRlcyBpbnRvIGEgcmVnaW9uIG9mIHNpemUgYmV0d2Vl?= =?UTF-8?B?biAwIGFuZCAxMDI0MCBbLVdmb3JtYXQtb3ZlcmZsb3c9XSBzaW5jZSByMTQt?= =?UTF-8?B?MjYxLWcwZWYzNzU2YWRmMDc4Yw==?= Date: Mon, 12 Feb 2024 10:23:23 +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: 14.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 14.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=3D113752 --- Comment #5 from Jakub Jelinek --- That said, the math at least in the reduced testcase is weird. %d output is at most 11 bytes - strlen ("-2147483648"), + 9 other chars, so that is 42, not 32. But even using + 42 in there instead of 32 doesn't fix it. It wouldn't surprise me if the misdesigned warning just sees that each of t= he strlens clearly has a range [0, 10256-42], after all, when expressed as a r= ange there isn't much more to derive about it, and then uses that [0, 10214] ran= ge for each of the %s specifiers. Though, that is not what the warning says. Ah, maybe it is because j is known short after inlining or some IPA opts. Also, because the strlen + strlen + strlen + cst > cst2 condition uses unsi= gned type, wrap around is theoretically possible, e.g. one could have some PTRDIFF_MAX - epsilon sized string and call it with c =3D g =3D j that stri= ng.=