tree-ssa-strlen.c (adjust_related_strinfos): Avoid trailing article.

gcc/ChangeLog:

	* tree-ssa-strlen.c (adjust_related_strinfos): Avoid trailing article.
	(handle_builtin_malloc): Remove trailing spaces.
	(handle_builtin_memset): Same.
	(handle_builtin_memcmp): Same.
	(compute_string_length): Same.
	(determine_min_objsize): Same.
	(handle_builtin_string_cmp): Same.
	(handle_char_store): Same.  Break up excessively long line.

From-SVN: r272016
This commit is contained in:
Martin Sebor 2019-06-06 18:46:20 +00:00 committed by Martin Sebor
parent c56c86024f
commit 2172277702
2 changed files with 70 additions and 57 deletions

View File

@ -1,3 +1,14 @@
2019-06-06 Martin Sebor <msebor@redhat.com>
* tree-ssa-strlen.c (adjust_related_strinfos): Avoid trailing article.
(handle_builtin_malloc): Remove trailing spaces.
(handle_builtin_memset): Same.
(handle_builtin_memcmp): Same.
(compute_string_length): Same.
(determine_min_objsize): Same.
(handle_builtin_string_cmp): Same.
(handle_char_store): Same. Break up excessively long line.
2019-06-06 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (build_reconstructed_reference): Drop the alignment

View File

@ -891,9 +891,9 @@ adjust_related_strinfos (location_t loc, strinfo *origsi, tree adj)
tree tem;
si = unshare_strinfo (si);
/* We shouldn't see delayed lengths here; the caller must have
calculated the old length in order to calculate the
adjustment. */
/* We shouldn't see delayed lengths here; the caller must
have calculated the old length in order to calculate
the adjustment. */
gcc_assert (si->nonzero_chars);
tem = fold_convert_loc (loc, TREE_TYPE (si->nonzero_chars), adj);
si->nonzero_chars = fold_build2_loc (loc, PLUS_EXPR,
@ -2898,8 +2898,8 @@ handle_builtin_memcmp (gimple_stmt_iterator *gsi)
return true;
}
/* Given an index to the strinfo vector, compute the string length for the
corresponding string. Return -1 when unknown. */
/* Given an index to the strinfo vector, compute the string length
for the corresponding string. Return -1 when unknown. */
static HOST_WIDE_INT
compute_string_length (int idx)
@ -2924,8 +2924,8 @@ compute_string_length (int idx)
return string_leni;
}
/* Determine the minimum size of the object referenced by DEST expression which
must have a pointer type.
/* Determine the minimum size of the object referenced by DEST expression
which must have a pointer type.
Return the minimum size of the object if successful or NULL when the size
cannot be determined. */
static tree
@ -2936,8 +2936,8 @@ determine_min_objsize (tree dest)
if (compute_builtin_object_size (dest, 2, &size))
return build_int_cst (sizetype, size);
/* Try to determine the size of the object through the RHS of the
assign statement. */
/* Try to determine the size of the object through the RHS
of the assign statement. */
if (TREE_CODE (dest) == SSA_NAME)
{
gimple *stmt = SSA_NAME_DEF_STMT (dest);
@ -2984,11 +2984,11 @@ determine_min_objsize (tree dest)
to a non-zero value.
* otherwise, do nothing now.
B. When the length of one argument is constant, try to replace the call with
a __builtin_str(n)cmp_eq call where possible, i.e:
B. When the length of one argument is constant, try to replace the call
with a __builtin_str(n)cmp_eq call where possible, i.e:
strncmp (s, STR, C) (!)= 0 in which, s is a pointer to a string, STR is a
string with constant length , C is a constant.
strncmp (s, STR, C) (!)= 0 in which, s is a pointer to a string, STR
is a string with constant length , C is a constant.
if (C <= strlen(STR) && sizeof_array(s) > C)
{
replace this call with
@ -3000,8 +3000,8 @@ determine_min_objsize (tree dest)
can handled by the following strcmp.
}
strcmp (s, STR) (!)= 0 in which, s is a pointer to a string, STR is a
string with constant length.
strcmp (s, STR) (!)= 0 in which, s is a pointer to a string, STR
is a string with constant length.
if (sizeof_array(s) > strlen(STR))
{
replace this call with
@ -3083,8 +3083,8 @@ handle_builtin_string_cmp (gimple_stmt_iterator *gsi)
return false;
}
/* When the lengths of both arguments are known, and they are unequal, we can
safely fold the call to a non-zero value for strcmp;
/* When the lengths of both arguments are known, and they are unequal,
we can safely fold the call to a non-zero value for strcmp;
othewise, do nothing now. */
if (idx1 != 0 && idx2 != 0)
{
@ -3376,7 +3376,9 @@ handle_char_store (gimple_stmt_iterator *gsi)
gsi_next (gsi);
return false;
}
else if (storing_all_zeros_p || storing_nonzero_p || (offset != 0 && cmp > 0))
else if (storing_all_zeros_p
|| storing_nonzero_p
|| (offset != 0 && cmp > 0))
{
/* When STORING_NONZERO_P, we know that the string will start
with at least OFFSET + 1 nonzero characters. If storing