From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66B513858C56; Fri, 7 Oct 2022 19:08:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66B513858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665169718; bh=NA+EkWUYMTedtEZPY0mS8e71E8W8Wpa1O1/mkI3fRy0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u4ezOBX6VBXyqxdHIIuxpYv8Xb1Q8LCzClyAFmbpHzo/HQZTPNGOH8eU5Yzvai5zC nk9WxCpsU3qRMGgu6AGXWzrkU9Dk6lyvOZJjUh2pLo6ErN9r3goUmxLQMHpLdqSVz8 tNCyibwpcNgOz+bfgdbF2NcwauZFGLpkJmRec6kY= From: "siddhesh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107038] Bogus -Wstringop-overflow in dead code Date: Fri, 07 Oct 2022 19:08: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: siddhesh 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 #8 from Siddhesh Poyarekar --- I forgot to mention that I've been building with: gcc/cc1 -o /dev/null ../bogus-stringop-overflow.i -O2 -Werror=3Dstringop-ov= erflow -quiet to reproduce the warning: ../bogus-stringop-overflow.i: In function =E2=80=98elf_begin_rand=E2=80=99: ../bogus-stringop-overflow.i:35:19: error: =E2=80=98foo_alias=E2=80=99 writ= ing 14 or more bytes into a region of size 10 overflows the destination [-Werror=3Dstringop-over= flow=3D] 35 | ret =3D foo_alias (buf, nbytes, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../bogus-stringop-overflow.i:14:8: note: destination object =E2=80=98ar_siz= e=E2=80=99 of size 10 14 | char ar_size[10]; | ^~~~~~~ ../bogus-stringop-overflow.i:8:16: note: in a call to function =E2=80=98foo= _alias=E2=80=99 declared with attribute =E2=80=98access (write_only, 1, 2)=E2=80=99 8 | extern ssize_t foo_alias (void *buf, size_t nbytes, off_t offset) | ^~~~~~~~~ cc1: some warnings being treated as errors=