diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2020-10-19 17:03:44 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2020-10-20 20:46:08 +0200 |
commit | e864d395b4e862cece37abe178e7ebd631b5348b (patch) | |
tree | e98603a69dac2fbaa26c12802bcca7ab1c702e90 /gcc/calls.h | |
parent | 495ec0b2aa808a6463b8c24288a1730cbae1cfca (diff) | |
download | gcc-e864d395b4e862cece37abe178e7ebd631b5348b.tar.gz |
Convert -Wrestrict pass to ranger.
There is one adjustment to a C++ test which now gives a false positive.
After talking with Martin Sebor, we've concluded this is expected. There
is no way to communicate that libstdc++ allocated objects are always
less than PTRDIFF_MAX.
gcc/ChangeLog:
* calls.c (get_size_range): Adjust to work with ranger.
* calls.h (get_size_range): Add ranger argument to prototype.
* gimple-ssa-warn-restrict.c (class wrestrict_dom_walker): Remove.
(check_call): Pull out of wrestrict_dom_walker into a
static function.
(wrestrict_dom_walker::before_dom_children): Rename to...
(wrestrict_walk): ...this.
(pass_wrestrict::execute): Instantiate ranger.
(class builtin_memref): Add stmt and query fields.
(builtin_access::builtin_access): Add range_query field.
(builtin_memref::builtin_memref): Same.
(builtin_memref::extend_offset_range): Same.
(builtin_access::builtin_access): Make work with ranger.
(wrestrict_dom_walker::check_call): Pull out into...
(check_call): ...here.
(check_bounds_or_overlap): Add range_query argument.
* gimple-ssa-warn-restrict.h (check_bounds_or_overlap):
Add range_query and gimple stmt arguments.
gcc/testsuite/ChangeLog:
* gcc.dg/Wrestrict-22.c: New test.
* g++.dg/torture/pr92421.C: Adjust for ranger.
libstdc++-v3/ChangeLog:
* testsuite/21_strings/basic_string/capacity/1.cc: Pass
-Wno-stringop-overflow to test.
Diffstat (limited to 'gcc/calls.h')
-rw-r--r-- | gcc/calls.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/calls.h b/gcc/calls.h index 644ec45d92c..f32b6308b58 100644 --- a/gcc/calls.h +++ b/gcc/calls.h @@ -142,6 +142,8 @@ enum size_range_flags SR_USE_LARGEST = 2 }; extern bool get_size_range (tree, tree[2], int = 0); +extern bool get_size_range (class range_query *, tree, gimple *, + tree[2], int = 0); extern rtx rtx_for_static_chain (const_tree, bool); extern bool cxx17_empty_base_field_p (const_tree); |