diff options
author | Richard Biener <rguenther@suse.de> | 2019-07-12 10:03:10 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-07-12 10:03:10 +0000 |
commit | 831e688af50c5f77a2daa3cd3bfd0f27d54d5d72 (patch) | |
tree | ea4a80650c7c4334d9576ee571c395e345cfec8a /gcc/fold-const.h | |
parent | e067f9924bad423bf6265b75414d3160e6cf660a (diff) |
fold-const.h (get_array_ctor_element_at_index): Adjust.
2019-07-12 Richard Biener <rguenther@suse.de>
* fold-const.h (get_array_ctor_element_at_index): Adjust.
* fold-const.c (get_array_ctor_element_at_index): Add
ctor_idx output parameter informing the caller where in
the constructor the element was (not) found. Add early exit
for when the ctor is sorted.
* gimple-fold.c (fold_array_ctor_reference): Support constant
folding across multiple array elements.
* gcc.dg/tree-ssa/vector-7.c: New testcase.
From-SVN: r273435
Diffstat (limited to 'gcc/fold-const.h')
-rw-r--r-- | gcc/fold-const.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fold-const.h b/gcc/fold-const.h index 2a69bf9163d..eab2b47a260 100644 --- a/gcc/fold-const.h +++ b/gcc/fold-const.h @@ -67,7 +67,8 @@ extern tree fold_build_call_array_loc (location_t, tree, tree, int, tree *); #define fold_build_call_array_initializer(T1,T2,N,T4)\ fold_build_call_array_initializer_loc (UNKNOWN_LOCATION, T1, T2, N, T4) extern tree fold_build_call_array_initializer_loc (location_t, tree, tree, int, tree *); -extern tree get_array_ctor_element_at_index (tree, offset_int); +extern tree get_array_ctor_element_at_index (tree, offset_int, + unsigned * = NULL); extern bool fold_convertible_p (const_tree, const_tree); #define fold_convert(T1,T2)\ fold_convert_loc (UNKNOWN_LOCATION, T1, T2) |