This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, 4.7] Have all inlining destinations "analyzed"


> Index: src/gcc/cgraph.c
> ===================================================================
> --- src.orig/gcc/cgraph.c
> +++ src/gcc/cgraph.c
> @@ -2495,11 +2495,11 @@ cgraph_add_new_function (tree fndecl, bo
>        case CGRAPH_STATE_FINISHED:
>  	/* At the very end of compilation we have to do all the work up
>  	   to expansion.  */
> +	node = cgraph_node (fndecl);
> +	cgraph_analyze_function (node);
>  	push_cfun (DECL_STRUCT_FUNCTION (fndecl));
>  	current_function_decl = fndecl;
>  	gimple_register_cfg_hooks ();
> -	if (!lowered)
> -          tree_lowering_passes (fndecl);

The analysis shoud happent in cgraph_process_new_functions that should be
called after every IPA pass.
I don't think we should move analysis here nor we should drop the !lowered path
(even if it is unused currently, cgraph_add_new_function is supposed to work
on unlowered functions).

So the problem is that the functions are added but not processed at inlining
time.  I do not see how this can happen given that we process new function
after every IPA pass and mudflap is not part of early optmizations.
Do you have any idea here?  Otherwise i will debug this.

Honza

>  	bitmap_obstack_initialize (NULL);
>  	if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)))
>  	  execute_pass_list (pass_early_local_passes.pass.sub);
> Index: src/gcc/cgraph.h
> ===================================================================
> --- src.orig/gcc/cgraph.h
> +++ src/gcc/cgraph.h
> @@ -618,6 +618,7 @@ bool varpool_used_from_object_file_p (st
>  extern FILE *cgraph_dump_file;
>  void cgraph_finalize_function (tree, bool);
>  void cgraph_mark_if_needed (tree);
> +void cgraph_analyze_function (struct cgraph_node *);
>  void cgraph_finalize_compilation_unit (void);
>  void cgraph_optimize (void);
>  void cgraph_mark_needed_node (struct cgraph_node *);
> Index: src/gcc/cgraphunit.c
> ===================================================================
> --- src.orig/gcc/cgraphunit.c
> +++ src/gcc/cgraphunit.c
> @@ -143,7 +143,6 @@ static void cgraph_expand_all_functions
>  static void cgraph_mark_functions_to_output (void);
>  static void cgraph_expand_function (struct cgraph_node *);
>  static void cgraph_output_pending_asms (void);
> -static void cgraph_analyze_function (struct cgraph_node *);
>  
>  FILE *cgraph_dump_file;
>  
> @@ -773,7 +772,7 @@ cgraph_output_pending_asms (void)
>  }
>  
>  /* Analyze the function scheduled to be output.  */
> -static void
> +void
>  cgraph_analyze_function (struct cgraph_node *node)
>  {
>    tree save = current_function_decl;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]