From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D99DC3858D38; Mon, 12 Feb 2024 10:09:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D99DC3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707732576; bh=Ne9BQdLma3OGDdN5O46e08thQ6P0acApzBEzig+D2ug=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aD2S2D9TRWhez9wf98z7LE+BIXUEjDfnGXx0+XacnQBp6/eA3OPmPnY+XfucAyR3p 1TFEYQgNdqceDjqqkH9PrCxxHATSVBTwNo5P7THyUk5gMC/mljH8RGULuQI6s0w1PC 05CInV4XUV1/+T829lR8GQMMsiMsh/0UgZl6VgWk= 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:09:36 +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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113752 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek --- Strange, it certainly does reproduce for me: char a[10256], b, *c, *g; int d, e, f; int foo (char *j) { if (__builtin_strlen (j) + __builtin_strlen (c) + __builtin_strlen (g) + = 32 > 10256) return 0; __builtin_sprintf (a, "%s:%s:%d:%d:%d:%c:%s\n", j, c, d, e, f, b, g); return 1; } void bar (void) { foo ("wctype"); } /volume/tor/opt/notnfs/gcc-bisect/obj/gcc/cc1.r14-8919 -quiet -O3 -Wall pr113752.c pr113752.c: In function =E2=80=98bar=E2=80=99: pr113752.c:9:44: warning: =E2=80=98%s=E2=80=99 directive writing up to 1021= 8 bytes into a region of size between 0 and 10240 [-Wformat-overflow=3D] 9 | __builtin_sprintf (a, "%s:%s:%d:%d:%d:%c:%s\n", j, c, d, e, f, b,= g); | ^~ In function =E2=80=98foo=E2=80=99, inlined from =E2=80=98bar=E2=80=99 at pr113752.c:16:3: pr113752.c:9:3: note: =E2=80=98__builtin_sprintf=E2=80=99 output between 18= and 20484 bytes into a destination of size 10256 9 | __builtin_sprintf (a, "%s:%s:%d:%d:%d:%c:%s\n", j, c, d, e, f, b,= g); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~ /volume/tor/opt/notnfs/gcc-bisect/obj/gcc/cc1.r14-260 -quiet -O3 -Wall pr113752.c /volume/tor/opt/notnfs/gcc-bisect/obj/gcc/cc1.r14-261 -quiet -O3 -Wall pr113752.c pr113752.c: In function =E2=80=98bar=E2=80=99: pr113752.c:9:44: warning: =E2=80=98%s=E2=80=99 directive writing up to 1021= 8 bytes into a region of size between 0 and 10240 [-Wformat-overflow=3D] 9 | __builtin_sprintf (a, "%s:%s:%d:%d:%d:%c:%s\n", j, c, d, e, f, b,= g); | ^~ In function =E2=80=98foo=E2=80=99, inlined from =E2=80=98bar=E2=80=99 at pr113752.c:16:3: pr113752.c:9:3: note: =E2=80=98__builtin_sprintf=E2=80=99 output between 18= and 20484 bytes into a destination of size 10256 9 | __builtin_sprintf (a, "%s:%s:%d:%d:%d:%c:%s\n", j, c, d, e, f, b,= g); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~=