aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2017-02-03 16:38:15 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2017-02-03 09:38:15 -0700
commit3f3430400b2ce552a5dbdae49a3a482687b96afa (patch)
treec78749d08d207350d71edfc1c5b9871d422a1f1c /gcc/tree.h
parent46a2ab580a762b0fc3e64dc4ab24d459a4bd1fd2 (diff)
downloadgcc-3f3430400b2ce552a5dbdae49a3a482687b96afa.zip
gcc-3f3430400b2ce552a5dbdae49a3a482687b96afa.tar.gz
gcc-3f3430400b2ce552a5dbdae49a3a482687b96afa.tar.bz2
PR tree-optimization/79352 - -fprintf-return-value doesn't handle flexible-like array members properly
gcc/ChangeLog: PR tree-optimization/79352 * gimple-fold.c (get_range_strlen): Add argument. (get_range_strlen): Change return type to bool. (get_maxval_strlen): Pass in a dummy argument. * gimple-fold.h (get_range_strlen): Change return type to bool. * gimple-ssa-sprintf.c (get_string_length): Set unlikely counter. * tree.h (array_at_struct_end_p): Add argument. * tree.c (array_at_struct_end_p): Handle it. gcc/testsuite/ChangeLog: PR tree-optimization/79352 * gcc.dg/tree-ssa/pr79352.c: New test. From-SVN: r245156
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 6341446..f63a678 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4855,8 +4855,10 @@ extern tree array_ref_low_bound (tree);
/* Returns true if REF is an array reference to an array at the end of
a structure. If this is the case, the array may be allocated larger
- than its upper bound implies. */
-extern bool array_at_struct_end_p (tree);
+ than its upper bound implies. When second argument is true considers
+ REF when it's a COMPONENT_REF in addition ARRAY_REF and
+ ARRAY_RANGE_REF. */
+extern bool array_at_struct_end_p (tree, bool = false);
/* Return a tree representing the offset, in bytes, of the field referenced
by EXP. This does not include any offset in DECL_FIELD_BIT_OFFSET. */