From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 995E8384D6FF; Tue, 6 Dec 2022 10:22:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 995E8384D6FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670322139; bh=WKxs/wQ7kkP3K3jH6hINLAEeqQDKYIupeBHB52UyBP0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DZTFwe1oysqmr1E9Bl+IxLntN/yiasIS6VfG8RjMh7tWxVmRKxnY79rf+dif/Slk+ tp9X5bauOH59EIvYeesJ8PnwQiStOjaXolmhOEuIp970jdwz5pDxdhdnnrs/eEzM7v +SqD0nd1mbmAJLqRJOMrMdWQCtXkQj9CQm9jUaac= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104475] [12/13 Regression] Wstringop-overflow + atomics incorrect warning on dynamic object Date: Tue, 06 Dec 2022 10:22:12 +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: 12.0 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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=3D104475 --- Comment #17 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:926f5059bb8d295e2b68cea7c9af53606946eb1a commit r13-4503-g926f5059bb8d295e2b68cea7c9af53606946eb1a Author: Richard Biener Date: Tue Dec 6 10:12:01 2022 +0100 tree-optimization/104475 - improve access diagnostics When we end up isolating a nullptr path it happens we diagnose accesses to offsetted nullptr objects. The current diagnostics have no good indication that this happens so the following records the fact that our heuristic detected a nullptr based access in the access_ref structure and sets up diagnostics to inform of that detail. The diagnostic itself could probably be improved here but its API is twisted and the necessary object isn't passed around. Instead of just ...bits/atomic_base.h:655:34: warning: 'unsigned int __atomic_fetch_and_4(volatile void*, unsigned int, int)' writing 4 bytes in= to a region of size 0 overflows the destination [-Wstringop-overflow=3D] we now add In member function 'void QFutureInterfaceBase::setThrottled(bool)': cc1plus: note: destination object is likely at address zero PR tree-optimization/104475 * pointer-query.h (access_ref::ref_nullptr_p): New flag. * pointer-query.cc (access_ref::access_ref): Initialize ref_nullptr_p. (compute_objsize_r): Set ref_nullptr_p if we treat it that way. (access_ref::inform_access): If ref was treated as nullptr based, indicate that.=