aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-08-08 09:18:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-08-08 09:18:40 +0000
commitfef5a0d95e0e593ace4be86a8aa27ebdaa92c078 (patch)
tree621bf63e4a68ad2ac887a0c87d72c5746a320a34 /gcc/gimple.c
parent322d490e02ff3008949d14370e651c89290465a6 (diff)
downloadgcc-fef5a0d95e0e593ace4be86a8aa27ebdaa92c078.zip
gcc-fef5a0d95e0e593ace4be86a8aa27ebdaa92c078.tar.gz
gcc-fef5a0d95e0e593ace4be86a8aa27ebdaa92c078.tar.bz2
builtins.c (c_getstr, [...]): Export.
2014-08-08 Richard Biener <rguenther@suse.de> * builtins.c (c_getstr, readonly_data_expr, init_target_chars, target_percent, target_percent_s): Export. (var_decl_component_p, fold_builtin_memory_op, fold_builtin_memset, fold_builtin_bzero, fold_builtin_strcpy, fold_builtin_strncpy, fold_builtin_strcat, fold_builtin_fputs, fold_builtin_memory_chk, fold_builtin_stxcpy_chk, fold_builtin_stxncpy_chk, fold_builtin_sprintf_chk_1, fold_builtin_snprintf_chk_1): Move to gimple-fold.c. (fold_builtin_2): Remove handling of bzero, fputs, fputs_unlocked, strcat and strcpy. (fold_builtin_3): Remove handling of memset, bcopy, memcpy, mempcpy, memmove, strncpy, strcpy_chk and stpcpy_chk. (fold_builtin_4): Remove handling of memcpy_chk, mempcpy_chk, memmove_chk, memset_chk, strncpy_chk and stpncpy_chk. (rewrite_call_expr_array): Remove. (fold_builtin_sprintf_chk): Likewise. (fold_builtin_snprintf_chk): Likewise. (fold_builtin_varargs): Remove handling of sprintf_chk, vsprintf_chk, snprintf_chk and vsnprintf_chk. (gimple_fold_builtin_sprintf_chk): Remove. (gimple_fold_builtin_snprintf_chk): Likewise. (gimple_fold_builtin_varargs): Likewise. (fold_call_stmt): Do not call gimple_fold_builtin_varargs. * predict.c (optimize_bb_for_size_p): Handle NULL bb. * gimple.c (gimple_seq_add_seq_without_update): New function. * gimple.h (gimple_seq_add_seq_without_update): Declare. * gimple-fold.c: Include output.h. (gsi_replace_with_seq_vops): New function, split out from ... (gimplify_and_update_call_from_tree): ... here. (replace_call_with_value): New function. (replace_call_with_call_and_fold): Likewise. (var_decl_component_p): Moved from builtins.c. (gimple_fold_builtin_memory_op): Moved from builtins.c fold_builtin_memory_op and rewritten to GIMPLE. (gimple_fold_builtin_memset): Likewise. (gimple_fold_builtin_strcpy): Likewise. (gimple_fold_builtin_strncpy): Likewise. (gimple_fold_builtin_strcat): Likewise. (gimple_fold_builtin_fputs): Likewise. (gimple_fold_builtin_memory_chk): Likewise. (gimple_fold_builtin_stxcpy_chk): Likewise. (gimple_fold_builtin_stxncpy_chk): Likewise. (gimple_fold_builtin_snprintf_chk): Likewise. (gimple_fold_builtin_sprintf_chk): Likewise. (gimple_fold_builtin_strlen): New function. (gimple_fold_builtin_with_strlen): New function split out from gimple_fold_builtin. (gimple_fold_builtin): Change signature and handle bzero, memset, bcopy, memcpy, mempcpy and memmove folding here. Call gimple_fold_builtin_with_strlen. (gimple_fold_call): Adjust. * gcc.dg/strlenopt-8.c: Remove XFAIL. * gcc.dg/tree-prof/stringop-2.c: Adjust. * gfortran.dg/array_memcpy_4.f90: Likewise. * gfortran.dg/trim_optimize_1.f90: Likewise. * gfortran.dg/trim_optimize_2.f90: Likewise. From-SVN: r213753
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 4a9d379..2104dd6 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -1178,6 +1178,21 @@ gimple_seq_add_seq (gimple_seq *dst_p, gimple_seq src)
gsi_insert_seq_after (&si, src, GSI_NEW_STMT);
}
+/* Append sequence SRC to the end of sequence *DST_P. If *DST_P is
+ NULL, a new sequence is allocated. This function is
+ similar to gimple_seq_add_seq, but does not scan the operands. */
+
+void
+gimple_seq_add_seq_without_update (gimple_seq *dst_p, gimple_seq src)
+{
+ gimple_stmt_iterator si;
+ if (src == NULL)
+ return;
+
+ si = gsi_last (*dst_p);
+ gsi_insert_seq_after_without_update (&si, src, GSI_NEW_STMT);
+}
+
/* Determine whether to assign a location to the statement GS. */
static bool