diff options
author | Richard Biener <rguenther@suse.de> | 2022-12-06 10:12:01 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2022-12-06 11:21:53 +0100 |
commit | 926f5059bb8d295e2b68cea7c9af53606946eb1a (patch) | |
tree | e43bf043f89463f1f5e0bfcbebb43215d2b66044 /gcc/c | |
parent | a0ee2e522523b35ac810bd31c9769b9906f87953 (diff) | |
download | gcc-926f5059bb8d295e2b68cea7c9af53606946eb1a.zip gcc-926f5059bb8d295e2b68cea7c9af53606946eb1a.tar.gz gcc-926f5059bb8d295e2b68cea7c9af53606946eb1a.tar.bz2 |
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 into a region of size 0 overflows the destination [-Wstringop-overflow=]
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.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions