diff options
author | Richard Biener <rguenther@suse.de> | 2014-01-20 11:01:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-01-20 11:01:53 +0000 |
commit | 409b6ac1969b3449bd90acf655cd55d97e4e0d29 (patch) | |
tree | acefd97caecfdc9b4721dee5e044b60c6623cb91 /gcc/builtins.c | |
parent | fd6e497e9cb9f0efe0375c65dddbe86f8e536f56 (diff) | |
download | gcc-409b6ac1969b3449bd90acf655cd55d97e4e0d29.zip gcc-409b6ac1969b3449bd90acf655cd55d97e4e0d29.tar.gz gcc-409b6ac1969b3449bd90acf655cd55d97e4e0d29.tar.bz2 |
re PR tree-optimization/59860 (ICE in compute_may_aliases, at tree-ssa-structalias.c:6843)
2014-01-20 Richard Biener <rguenther@suse.de>
PR middle-end/59860
* builtins.c (fold_builtin_strcat): Remove case better handled
by tree-ssa-strlen.c.
* gcc.dg/pr59860.c: New testcase.
From-SVN: r206799
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 983cbc5..c597e44 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -11760,17 +11760,11 @@ fold_builtin_strcat (location_t loc ATTRIBUTE_UNUSED, tree dst, tree src) if (!strlen_fn || !strcpy_fn) return NULL_TREE; - /* If we don't have a movstr we don't want to emit an strcpy - call. We have to do that if the length of the source string - isn't computable (in that case we can use memcpy probably - later expanding to a sequence of mov instructions). If we - have movstr instructions we can emit strcpy calls. */ - if (!HAVE_movstr) - { - tree len = c_strlen (src, 1); - if (! len || TREE_SIDE_EFFECTS (len)) - return NULL_TREE; - } + /* If the length of the source string isn't computable don't + split strcat into strlen and strcpy. */ + tree len = c_strlen (src, 1); + if (! len || TREE_SIDE_EFFECTS (len)) + return NULL_TREE; /* Stabilize the argument list. */ dst = builtin_save_expr (dst); |