aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2004-07-11 18:14:48 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2004-07-11 18:14:48 +0000
commit9675412fd923871ec44eb30d70d3ef0f9d7811b6 (patch)
tree8ae61f65db968c0c276e91209918fc11f50b63e4 /gcc/builtins.c
parentfa27426eb1377c2a9e23f58424b4da5497e78c8d (diff)
downloadgcc-9675412fd923871ec44eb30d70d3ef0f9d7811b6.zip
gcc-9675412fd923871ec44eb30d70d3ef0f9d7811b6.tar.gz
gcc-9675412fd923871ec44eb30d70d3ef0f9d7811b6.tar.bz2
builtins.c (fold_builtin_fputs): Don't bother converting the return type to integer_type_node...
* builtins.c (fold_builtin_fputs): Don't bother converting the return type to integer_type_node, as we've already checked that the result will be ignored. * tree-eh.c (tree_could_trap_p): Add support for -ftrapv such that signed addition, subtraction, multiplication, division, remainder, negation and absolute value may potentially trap. * fold-const.c (fold_ignored_result): New function to strip non-side-effecting tree nodes from an expression whose result is ignored. (fold_convert): Call fold_ignored_result when casting a value to VOID_TYPE. (omit_one_operand): Call fold_ignored_result on the "omitted" operand when building a COMPOUND_EXPR. (pedantic_omit_one_operand): Likewise. * tree.h (fold_ignored_result): Prototype here. * tree-ssa-ccp.c (ccp_fold_builtin): Call fold_ignored_result when we're going to ignore the result. From-SVN: r84525
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 02fdc92..5b2a63f 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -9474,8 +9474,9 @@ fold_builtin_fputs (tree arglist, bool ignore, bool unlocked, tree len)
abort ();
}
- return fold_convert (integer_type_node,
- build_function_call_expr (fn, arglist));
+ /* These optimizations are only performed when the result is ignored,
+ hence there's no need to cast the result to integer_type_node. */
+ return build_function_call_expr (fn, arglist);
}
static void