+2018-12-23 Martin Sebor <msebor@redhat.com>
+ Jeff Law <law@redhat.com>
+
+ * builtins.c (unterminated_array): Use empty brace initialization
+ for c_strlen_data.
+ (c_strlen, expand_builtin_strnlen): Likewise.
+ (expand_builtin_stpcpy_1, fold_builtin_strlen): Likewise.
+ * gimple-fold.c (get_range_strlen): Likewise.
+ (gimple_fold_builtin_stpcpy): Likewise.
+ * gimple-ssa-sprintf.c (get_string_length): Likewise.
+
2018-12-23 Alan Modra <amodra@gmail.com>
PR 88346
{
/* C_STRLEN will return NULL and set DECL in the info
structure if EXP references a unterminated array. */
- c_strlen_data data;
- memset (&data, 0, sizeof (c_strlen_data));
+ c_strlen_data data = { };
tree len = c_strlen (exp, 1, &data);
if (len == NULL_TREE && data.len && data.decl)
{
/* If we were not passed a DATA pointer, then get one to a local
structure. That avoids having to check DATA for NULL before
each time we want to use it. */
- c_strlen_data local_strlen_data;
- memset (&local_strlen_data, 0, sizeof (c_strlen_data));
+ c_strlen_data local_strlen_data = { };
if (!data)
data = &local_strlen_data;
/* FIXME: Change c_strlen() to return sizetype instead of ssizetype
so these conversions aren't necessary. */
- c_strlen_data data;
- memset (&data, 0, sizeof (c_strlen_data));
+ c_strlen_data data { };
tree len = c_strlen (src, 0, &data, 1);
if (len)
len = fold_convert_loc (loc, TREE_TYPE (bound), len);
compile-time, not an expression containing a string. This is
because the latter will potentially produce pessimized code
when used to produce the return value. */
- c_strlen_data data;
- memset (&data, 0, sizeof (c_strlen_data));
+ c_strlen_data data = { };
if (!c_getstr (src, NULL)
|| !(len = c_strlen (src, 0, &data, 1)))
return expand_movstr (dst, src, target,
return NULL_TREE;
else
{
- c_strlen_data data;
- memset (&data, 0, sizeof (c_strlen_data));
+ c_strlen_data data = { };
tree len = c_strlen (arg, 0, &data);
if (len)
}
else
{
- c_strlen_data data;
- memset (&data, 0, sizeof (c_strlen_data));
+ c_strlen_data data = { };
val = c_strlen (arg, 1, &data, eltsize);
/* If we potentially had a non-terminated string, then
}
/* Set to non-null if ARG refers to an unterminated array. */
- c_strlen_data data;
- memset (&data, 0, sizeof (c_strlen_data));
+ c_strlen_data data = { };
tree len = c_strlen (src, 1, &data, 1);
if (!len
|| TREE_CODE (len) != INTEGER_CST)