aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index aa0cfaf8dd1..1e4f9305138 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -3472,8 +3472,12 @@ expand_builtin_fputs (arglist, ignore, unlocked)
/* FALLTHROUGH */
case 1: /* length is greater than 1, call fwrite. */
{
- tree string_arg = TREE_VALUE (arglist);
+ tree string_arg;
+ /* If optimizing for size keep fputs. */
+ if (optimize_size)
+ return 0;
+ string_arg = TREE_VALUE (arglist);
/* New argument list transforming fputs(string, stream) to
fwrite(string, 1, len, stream). */
arglist = build_tree_list (NULL_TREE, TREE_VALUE (TREE_CHAIN (arglist)));
@@ -3519,7 +3523,7 @@ expand_builtin_expect (arglist, target)
target = expand_expr (exp, target, VOIDmode, EXPAND_NORMAL);
/* Don't bother with expected value notes for integral constants. */
- if (GET_CODE (target) != CONST_INT)
+ if (flag_guess_branch_prob && GET_CODE (target) != CONST_INT)
{
/* We do need to force this into a register so that we can be
moderately sure to be able to correctly interpret the branch
@@ -3691,6 +3695,9 @@ expand_builtin (exp, target, subtarget, mode, ignore)
tree arglist = TREE_OPERAND (exp, 1);
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
+ /* Perform postincrements before expanding builtin functions.  */
+ emit_queue ();
+
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
return (*targetm.expand_builtin) (exp, target, subtarget, mode, ignore);