From: jakub Date: Fri, 27 Mar 2009 21:36:53 +0000 (+0000) Subject: * tree-inline.c: Include gt-tree-inline.h. X-Git-Tag: upstream/4.9.2~37389 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38150ede8ad6888fdd345bee3712de01636a1e3e;p=platform%2Fupstream%2Flinaro-gcc.git * tree-inline.c: Include gt-tree-inline.h. (clone_fn_id_num): New variable. (clone_function_name): New function. (tree_function_versioning): Use it. * Makefile.in (GTFILES): Add tree-inline.c. * gcc.dg/ipa/ipacost-1.c: Adjust match pattern for change in clone naming. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145126 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f07b247..b1e391a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-03-27 Jakub Jelinek + + * tree-inline.c: Include gt-tree-inline.h. + (clone_fn_id_num): New variable. + (clone_function_name): New function. + (tree_function_versioning): Use it. + * Makefile.in (GTFILES): Add tree-inline.c. + 2009-03-27 Mark Mitchell * BASE-VER: Change to 4.5.0. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 8850231..e973c2a 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3308,7 +3308,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \ $(srcdir)/tree-ssa-propagate.c \ $(srcdir)/tree-phinodes.c \ $(srcdir)/ipa-reference.c $(srcdir)/tree-ssa-structalias.h \ - $(srcdir)/tree-ssa-structalias.c \ + $(srcdir)/tree-ssa-structalias.c $(srcdir)/tree-inline.c \ @all_gtfiles@ # Compute the list of GT header files from the corresponding C sources, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 38567f6..295eb89 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-03-27 Jakub Jelinek + + * gcc.dg/ipa/ipacost-1.c: Adjust match pattern for change + in clone naming. + 2009-03-27 Xinliang David Li PR tree-optimization/39557 diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c index ac013a7..1c75c6c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c +++ b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c @@ -53,6 +53,7 @@ main() /* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully " 1 "cp" } } */ /* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully2" "cp" } } */ /* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully " "cp" } } */ -/* { dg-final { scan-tree-dump-not "i_can_be_propagated" "optimized" } } */ +/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully " "optimized" } } */ +/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 " "optimized" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 15419c3..e6a2fb3 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4268,6 +4268,29 @@ tree_versionable_function_p (tree fndecl) return true; } +/* Create a new name for omp child function. Returns an identifier. */ + +static GTY(()) unsigned int clone_fn_id_num; + +static tree +clone_function_name (tree decl) +{ + tree name = DECL_ASSEMBLER_NAME (decl); + size_t len = IDENTIFIER_LENGTH (name); + char *tmp_name, *prefix; + + prefix = XALLOCAVEC (char, len + strlen ("_clone") + 1); + memcpy (prefix, IDENTIFIER_POINTER (name), len); + strcpy (prefix + len, "_clone"); +#ifndef NO_DOT_IN_LABEL + prefix[len] = '.'; +#elif !defined NO_DOLLAR_IN_LABEL + prefix[len] = '$'; +#endif + ASM_FORMAT_PRIVATE_NAME (tmp_name, prefix, clone_fn_id_num++); + return get_identifier (tmp_name); +} + /* Create a copy of a function's tree. OLD_DECL and NEW_DECL are FUNCTION_DECL tree nodes of the original function and the new copied function @@ -4315,7 +4338,7 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map, /* Generate a new name for the new version. */ if (!update_clones) { - DECL_NAME (new_decl) = create_tmp_var_name (NULL); + DECL_NAME (new_decl) = clone_function_name (old_decl); SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl)); SET_DECL_RTL (new_decl, NULL_RTX); id.statements_to_fold = pointer_set_create (); @@ -4520,3 +4543,5 @@ tree_can_inline_p (tree caller, tree callee) /* Allow the backend to decide if inlining is ok. */ return targetm.target_option.can_inline_p (caller, callee); } + +#include "gt-tree-inline.h"