aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-array-bounds.h
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2021-07-26 09:47:42 +0200
committerAldy Hernandez <aldyh@redhat.com>2021-07-26 11:55:24 +0200
commitdd44445f09bcf92198e9238a28bf026959152be1 (patch)
tree5758cdc6fec2bd1a34a0996e6482395461b6fb31 /gcc/gimple-array-bounds.h
parent1ab2270036dc0f2a13442ce682267bc7433ffb34 (diff)
downloadgcc-dd44445f09bcf92198e9238a28bf026959152be1.zip
gcc-dd44445f09bcf92198e9238a28bf026959152be1.tar.gz
gcc-dd44445f09bcf92198e9238a28bf026959152be1.tar.bz2
Pass gimple context to array_bounds_checker.
I have changed the use of the array_bounds_checker in VRP to use a ranger in my local tree to make sure there are no regressions when using either VRP or the ranger. In doing so I noticed that the checker does not pass context to get_value_range, which causes the ranger to miss a few cases. This patch fixes the oversight. Tested on x86-64 Linux using the array bounds checker both with VRP and the ranger. gcc/ChangeLog: * gimple-array-bounds.cc (array_bounds_checker::get_value_range): Add gimple argument. (array_bounds_checker::check_array_ref): Same. (array_bounds_checker::check_addr_expr): Same. (array_bounds_checker::check_array_bounds): Pass statement to check_array_bounds and check_addr_expr. * gimple-array-bounds.h (check_array_bounds): Add gimple argument. (check_addr_expr): Same. (get_value_range): Same.
Diffstat (limited to 'gcc/gimple-array-bounds.h')
-rw-r--r--gcc/gimple-array-bounds.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/gimple-array-bounds.h b/gcc/gimple-array-bounds.h
index fa64262..d8f7ff7 100644
--- a/gcc/gimple-array-bounds.h
+++ b/gcc/gimple-array-bounds.h
@@ -31,10 +31,10 @@ public:
private:
static tree check_array_bounds (tree *tp, int *walk_subtree, void *data);
- bool check_array_ref (location_t, tree, bool ignore_off_by_one);
+ bool check_array_ref (location_t, tree, gimple *, bool ignore_off_by_one);
bool check_mem_ref (location_t, tree, bool ignore_off_by_one);
- void check_addr_expr (location_t, tree);
- const value_range *get_value_range (const_tree op);
+ void check_addr_expr (location_t, tree, gimple *);
+ const value_range *get_value_range (const_tree op, gimple *);
struct function *fun;
range_query *ranges;