summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-20 11:01:53 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-20 11:01:53 +0000
commitd4addd98c9c1883eb246beb667b805b3ac2d5711 (patch)
treeacefd97caecfdc9b4721dee5e044b60c6623cb91 /gcc/builtins.c
parentde6194016356223706cbd2a3d8f2a712696f191b (diff)
downloadlinaro-gcc-d4addd98c9c1883eb246beb667b805b3ac2d5711.tar.gz
linaro-gcc-d4addd98c9c1883eb246beb667b805b3ac2d5711.tar.bz2
linaro-gcc-d4addd98c9c1883eb246beb667b805b3ac2d5711.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206799 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 983cbc5b9e7..c597e44e58c 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);