Commit e7f9dae0 by Jakub Jelinek Committed by Jakub Jelinek

tree.h (avoid_folding_inline_builtin): New prototype.

	* tree.h (avoid_folding_inline_builtin): New prototype.
	* builtins.c (avoid_folding_inline_builtin): No longer static.
	* gimple-fold.c (gimple_fold_builtin): Give up if
	avoid_folding_inline_builtin returns true.

From-SVN: r179614
parent bc622b2a
2011-10-06 Jakub Jelinek <jakub@redhat.com>
* tree.h (avoid_folding_inline_builtin): New prototype.
* builtins.c (avoid_folding_inline_builtin): No longer static.
* gimple-fold.c (gimple_fold_builtin): Give up if
avoid_folding_inline_builtin returns true.
2011-10-06 Richard Guenther <rguenther@suse.de> 2011-10-06 Richard Guenther <rguenther@suse.de>
* tree-vect-generic.c (vector_element): Look at previous * tree-vect-generic.c (vector_element): Look at previous
...@@ -10360,7 +10360,7 @@ fold_builtin_varargs (location_t loc, tree fndecl, tree exp, ...@@ -10360,7 +10360,7 @@ fold_builtin_varargs (location_t loc, tree fndecl, tree exp,
been inlined, otherwise e.g. -D_FORTIFY_SOURCE checking been inlined, otherwise e.g. -D_FORTIFY_SOURCE checking
might not be performed. */ might not be performed. */
static bool bool
avoid_folding_inline_builtin (tree fndecl) avoid_folding_inline_builtin (tree fndecl)
{ {
return (DECL_DECLARED_INLINE_P (fndecl) return (DECL_DECLARED_INLINE_P (fndecl)
......
...@@ -828,6 +828,11 @@ gimple_fold_builtin (gimple stmt) ...@@ -828,6 +828,11 @@ gimple_fold_builtin (gimple stmt)
if (DECL_BUILT_IN_CLASS (callee) == BUILT_IN_MD) if (DECL_BUILT_IN_CLASS (callee) == BUILT_IN_MD)
return NULL_TREE; return NULL_TREE;
/* Give up for always_inline inline builtins until they are
inlined. */
if (avoid_folding_inline_builtin (callee))
return NULL_TREE;
/* If the builtin could not be folded, and it has no argument list, /* If the builtin could not be folded, and it has no argument list,
we're done. */ we're done. */
nargs = gimple_call_num_args (stmt); nargs = gimple_call_num_args (stmt);
......
...@@ -5352,6 +5352,7 @@ fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off) ...@@ -5352,6 +5352,7 @@ fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off)
fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o) fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o)
/* In builtins.c */ /* In builtins.c */
extern bool avoid_folding_inline_builtin (tree);
extern tree fold_call_expr (location_t, tree, bool); extern tree fold_call_expr (location_t, tree, bool);
extern tree fold_builtin_fputs (location_t, tree, tree, bool, bool, tree); extern tree fold_builtin_fputs (location_t, tree, tree, bool, bool, tree);
extern tree fold_builtin_strcpy (location_t, tree, tree, tree, tree); extern tree fold_builtin_strcpy (location_t, tree, tree, tree, tree);
......
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