Commit 543e2cc3 by Volker Reichelt Committed by Volker Reichelt

builtins.c (expand_builtin_strcat): Remove superfluous call to fold.

	* builtins.c (expand_builtin_strcat): Remove superfluous call to fold.
	(fold_builtin_isdigit): Use fold_buildN.
	(build_function_call_expr): Likewise.
	* c-typeck.c (c_finish_loop): Likewise.

From-SVN: r103154
parent 28f52a4d
2005-08-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* builtins.c (expand_builtin_strcat): Remove superfluous call to fold.
(fold_builtin_isdigit): Use fold_buildN.
(build_function_call_expr): Likewise.
* c-typeck.c (c_finish_loop): Likewise.
2005-08-16 J"orn Rennecke <joern.rennecke@st.com> 2005-08-16 J"orn Rennecke <joern.rennecke@st.com>
Richard Shann <rshann@superh.com> Richard Shann <rshann@superh.com>
......
...@@ -3860,9 +3860,8 @@ expand_builtin_strcat (tree arglist, tree type, rtx target, enum machine_mode mo ...@@ -3860,9 +3860,8 @@ expand_builtin_strcat (tree arglist, tree type, rtx target, enum machine_mode mo
/* Create strlen (dst). */ /* Create strlen (dst). */
newdst = newdst =
fold (build_function_call_expr (strlen_fn, build_function_call_expr (strlen_fn,
build_tree_list (NULL_TREE, build_tree_list (NULL_TREE, dst));
dst)));
/* Create (dst + (cast) strlen (dst)). */ /* Create (dst + (cast) strlen (dst)). */
newdst = fold_convert (TREE_TYPE (dst), newdst); newdst = fold_convert (TREE_TYPE (dst), newdst);
newdst = fold_build2 (PLUS_EXPR, TREE_TYPE (dst), dst, newdst); newdst = fold_build2 (PLUS_EXPR, TREE_TYPE (dst), dst, newdst);
...@@ -8291,9 +8290,8 @@ fold_builtin_isdigit (tree arglist) ...@@ -8291,9 +8290,8 @@ fold_builtin_isdigit (tree arglist)
arg = fold_convert (unsigned_type_node, TREE_VALUE (arglist)); arg = fold_convert (unsigned_type_node, TREE_VALUE (arglist));
arg = build2 (MINUS_EXPR, unsigned_type_node, arg, arg = build2 (MINUS_EXPR, unsigned_type_node, arg,
build_int_cst (unsigned_type_node, target_digit0)); build_int_cst (unsigned_type_node, target_digit0));
arg = build2 (LE_EXPR, integer_type_node, arg, arg = fold_build2 (LE_EXPR, integer_type_node, arg,
build_int_cst (unsigned_type_node, 9)); build_int_cst (unsigned_type_node, 9));
arg = fold (arg);
if (in_gimple_form && !TREE_CONSTANT (arg)) if (in_gimple_form && !TREE_CONSTANT (arg))
return NULL_TREE; return NULL_TREE;
else else
...@@ -8929,9 +8927,8 @@ build_function_call_expr (tree fn, tree arglist) ...@@ -8929,9 +8927,8 @@ build_function_call_expr (tree fn, tree arglist)
tree call_expr; tree call_expr;
call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn); call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
call_expr = build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)), return fold_build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)),
call_expr, arglist, NULL_TREE); call_expr, arglist, NULL_TREE);
return fold (call_expr);
} }
/* This function validates the types of a function call argument list /* This function validates the types of a function call argument list
......
...@@ -7086,8 +7086,7 @@ c_finish_loop (location_t start_locus, tree cond, tree incr, tree body, ...@@ -7086,8 +7086,7 @@ c_finish_loop (location_t start_locus, tree cond, tree incr, tree body,
} }
t = build_and_jump (&blab); t = build_and_jump (&blab);
exit = build3 (COND_EXPR, void_type_node, cond, exit, t); exit = fold_build3 (COND_EXPR, void_type_node, cond, exit, t);
exit = fold (exit);
if (cond_is_first) if (cond_is_first)
SET_EXPR_LOCATION (exit, start_locus); SET_EXPR_LOCATION (exit, start_locus);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment