From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 472AD3858404; Sat, 27 May 2023 01:39:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 472AD3858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685151564; bh=UJfrBfPYahVk1wL0i9BifRj+cYDEkZ57xO1gsztlv88=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ovm9Om3aQMrF3YMrKMORjhDS9owa527HxFiJMaQZ4Rd1Vt7tNqRaLYaysKxuEeDHI AxluSa8O3yZwr4w186YbFL5r+mRbLYWM64FnyW/9wuaYe9ddk0Etln71iH1Ts84A4v p0rPNjODnoIaoqRwlmT7RnSJv9tEMaEKQuMaEE84= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/109980] Bogus Wstringop-overflow and Wstringop-overread warnings when attribute `access` is applied to struct arg Date: Sat, 27 May 2023 01:39:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 13.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed bug_status cf_reconfirmed_on 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=3D109980 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2023-05-27 --- Comment #1 from Andrew Pinski --- Confirmed. Note the -O2 difference just comes from inlining. So you could get away with just this for getting the warning: ``` typedef struct{ int value, decoy; } S; [[gnu::access(read_write, 1)]] int S_rw(S *self); [[gnu::access(read_only, 1)]] int S_ro(const S *self); int S_test(S *tmps){ return tmps[1].value && S_rw(tmps + 1) && S_ro(tmps + 1); } ```=