From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 092B7384A02E; Fri, 19 Mar 2021 16:59:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 092B7384A02E From: "arnd at linaro dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/99673] New: [11 Regression] bogus -Wstringop-overread warning with address sanitizer Date: Fri, 19 Mar 2021 16:59:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: arnd at linaro dot 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: 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: Fri, 19 Mar 2021 16:59:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99673 Bug ID: 99673 Summary: [11 Regression] bogus -Wstringop-overread warning with address sanitizer Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: arnd at linaro dot org CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxi= n at gcc dot gnu.org Target Milestone: --- Created attachment 50435 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50435&action=3Dedit manually reduced test case gcc-11 warns about one file in the linux kernel, in which it fails to find = the size of an object: $ arm-linux-gnueabi-gcc -Os -fno-inline-functions-called-once=20 -fsanitize=3Daddress In function =E2=80=98ath11k_peer_assoc_h_vht=E2=80=99, inlined from =E2=80=98ath11k_peer_assoc_prepare=E2=80=99 at drivers/net/wireless/ath/ath11k/mac.c:92:2: drivers/net/wireless/ath/ath11k/mac.c:66:13: warning: =E2=80=98ath11k_peer_assoc_h_vht_masked=E2=80=99 reading 16 bytes from a re= gion of size 4 [-Wstringop-overread] 66 | if (ath11k_peer_assoc_h_vht_masked(vht_mcs_mask)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/ath/ath11k/mac.c: In function =E2=80=98ath11k_peer_ass= oc_prepare=E2=80=99: drivers/net/wireless/ath/ath11k/mac.c:66:13: note: referencing argument 1 of type =E2=80=98const u16 *=E2=80=99 {aka =E2=80=98const short unsigned int *= =E2=80=99} drivers/net/wireless/ath/ath11k/mac.c:49:1: note: in a call to function =E2=80=98ath11k_peer_assoc_h_vht_masked=E2=80=99 49 | ath11k_peer_assoc_h_vht_masked(const u16 vht_mcs_mask[NL80211_VHT_NSS_MAX]) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I can't see where the '4' even comes from here, both in the original test c= ase and the reduced version https://godbolt.org/z/79GE8M $ arm-linux-gnueabi-gcc --version arm-linux-gnueabi-gcc (GCC) 11.0.1 20210315 (experimental) The behavior seems to be target independent, I can reproduce it on arm and = x86.=