summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-17 01:38:24 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-17 01:38:24 +0000
commit7bb1accd1c52f4afd71339f9a487fa6f67c07a2a (patch)
tree38e92bac3ceb99b5ed8ffd6a613872242269dbc4 /gcc/builtins.c
parentefb2daa1899e9f0341879e7b5743b8e78c91df1e (diff)
downloadgcc-7bb1accd1c52f4afd71339f9a487fa6f67c07a2a.tar.gz
PR middle-end/21024
* builtins.c (expand_builtin_strcat): Convert the result of strlen to the right type. * fold-const.c (fold_binary) <PLUS_EXPR>: Use fold_convert to avoid creating type mismatches. <GE_EXPR>: Pass op0 and op1 to fold_build2 to avoid creating type mismatches. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98244 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index f39a073951b..33102e08e55 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -3810,7 +3810,8 @@ expand_builtin_strcat (tree arglist, tree type, rtx target, enum machine_mode mo
fold (build_function_call_expr (strlen_fn,
build_tree_list (NULL_TREE,
dst)));
- /* Create (dst + strlen (dst)). */
+ /* Create (dst + (cast) strlen (dst)). */
+ newdst = fold_convert (TREE_TYPE (dst), newdst);
newdst = fold (build2 (PLUS_EXPR, TREE_TYPE (dst), dst, newdst));
/* Prepend the new dst argument. */