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] turn cfun->local_decls into a VEC


On Wed, Jun 30, 2010 at 7:09 PM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> Enough with those trivial TREE_LIST removal patches that break
> bootstrap. ?How about a patch that does some real damage? :)
>
> The patch below turns cfun->local_decls into a VEC. ?The order of the
> elements in the list doesn't matter, so it's straightforward to retain
> the same time bounds for deleting elements in the few places that we do
> that. ?add_local_decl helps localize the allocation type of the
> local_decls VEC (and came in handy when I realized that the vector
> couldn't be heap allocated); FOR_EACH_VEC_ELT_REVERSE and
> FOR_EACH_LOCAL_DECL help to not make dumb mistakes while converting
> everything over. ?Both of these additions also make things clearer.
>
> Bootstrapped/tested on x86_64-unknown-linux-gnu, all languages except
> for lto (libjava/libstdc++ rebuild and test still ongoing, but expected
> to succeed). ?I understand that I need to install gold to test that and
> will perform that testing prior to installing the patch. ?OK to commit?
>
> -Nathan
>
> gcc/
> ? ? ? ?* vec.h (FOR_EACH_VEC_ELT_REVERSE): New macro.
> ? ? ? ?* function.h (struct_function): Change type of local_decls field
> ? ? ? ?to a VEC.
> ? ? ? ?(add_local_decl): New function.
> ? ? ? ?(FOR_EACH_LOCAL_DECL): New macro.
> ? ? ? ?* cfgexpand.c (init_vars_expansion): Adjust for new type of
> ? ? ? ?cfun->local_decls.
> ? ? ? ?(estimated_stack_frame_size): Likewise.
> ? ? ? ?(expand_used_vars): Likewise.
> ? ? ? ?* cgraphbuild.c (build_cgraph_edges): Likewise.
> ? ? ? ?* function.c (instantiate_decls_1): Likewise.
> ? ? ? ?* ipa-struct-reorg.c (build_data_structure): Likewise.
> ? ? ? ?* ipa-type-escape.c (analyze_function): Likewise.
> ? ? ? ?* lto-streamer-in.c (input_function): Likewise.
> ? ? ? ?* lto-streamer-out.c (output_function): Likewise.
> ? ? ? ?* tree-ssa-live.c (remove_unused_locals): Likewise.
> ? ? ? ?* tree.c (free_lang_data_in_decl): Likewise.
> ? ? ? ?(find_decls_types_in_node): Likewise.
> ? ? ? ?* omp-low.c (remove_exit_barrier): Likewise.
> ? ? ? ?(expand_omp_taskreg): Likewise.
> ? ? ? ?(list2chain): Rename to...
> ? ? ? ?(vec2chain): ...this. ?Adjust.
> ? ? ? ?* cgraphunit.c (assemble_thunk): Call add_local_decl.
> ? ? ? ?* tree-cfg.c (replace_by_duplicate_decl): Likewise.
> ? ? ? ?* gimple-low.c (record_vars_into): Likewise.
> ? ? ? ?* tree-inline.c (remap_decls): Likewise.
> ? ? ? ?(declare_return_variable): Likewise.
> ? ? ? ?(declare_inline_vars): Likewise.
> ? ? ? ?(copy_forbidden): Adjust for new type of cfun->local_decls.
> ? ? ? ?(add_local_variables): New function.
> ? ? ? ?(expand_call_inline): Call it.
> ? ? ? ?(tree_function_versioning): Likewise.
>
> gcc/cp/
> ? ? ? ?* decl.c (cp_finish_decl): Call add_local_decl.
> ? ? ? ?* optimize.c (clone_body): Adjust for new type of cfun->local_decls.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44901


-- 
H.J.


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