From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AB711385DC03; Wed, 1 Apr 2020 19:46:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB711385DC03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585770395; bh=38w51Mh28a7+GGpm1B4yrKqgEc0+r06ybq+RjlJVUj4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HpBF42d7WaacM8+/Q6wGEIU58+wYOcKnC0/HoYtk+MJfr3awmPM/fs/0W197wOFfe bU98z7kxRagXwjLdM7hst2hhKObJot9S/IyArG8zK3A5p2MiaPqCfcxPf8amKWcisD 0sh0OPwoUxmjvG5xlt9fIqrXzoGOnd6whtYxaVYc= From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/94444] __attribute__((access(...))) ignored for memcpy when compiling with -Os Date: Wed, 01 Apr 2020 19:46:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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_status resolution keywords 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 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: Wed, 01 Apr 2020 19:46:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94444 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |WONTFIX Keywords| |diagnostic --- Comment #5 from Martin Sebor --- Attribute access has an effect only on calls present in the IL after all optimizations have run. In the test case, because the local variable isn't used after the copy, the call is removed and there is no warning. (The war= ning comes back if the buffer is used or made extern or static.) This is by des= ign, and expected not just of the attribute but of most late warnings (including, for example, -Warray-bounds). Doing otherwise and processing the attribute much earlier would lead to warnings for unreachable code that most users vi= ew as false positives. We have no plans to change it.=