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]

struct function cleanup part III


Hi,
this patch continues the struct function breakup with stuff I for various
reasons didn't wanted to bundle in patch #2.  I am now mostly done with
non-flags fields. I would like to address flags next.  

The patch does the following:
  - move max_jumptable_ents and last_label_uid to CFG structure since those are used by CFG code.

    max_jumptable_ents stuff is used to build edge cache on RTL CFG build time when CFG might
    be dense.  I think it ought to be done both on trees and RTL, so this is why it is not housed
    in RTL struct.  I have patch for tree part, but I would like to benchmark it first.

  - move stack_protect_guard, stack_alignment_needed, preferred_stack_boundary and epilogue_delay_list
    to RTL struct.

  - rename unexpanded_var_list to local_decls.  I think the original name is terribly missleading
    since the list is not containing just vars and it is not that much about expansion.
    I am open to better name suggestions though.  It is bundled in this patch mostly because I intended
    to move it to gimple_df, but can't.  gimple_df currently is initialized at tree-ssa construction
    time that is too late.  It might make sense to move it to gimplification time, since stuff
    like value histograms and local_decls can be housed there then easilly.

    Every function we gimplify we either want to optimize, or jsut want to get warnings out.  So the
    gimplified but not turned to SSA functions should not be numberous.

Struct function now contain mainly pointers to the gimple stuff and EH (I have
patch to breakup RTL part of EH too) and some data for nested functions handling.  With removing
those, the whole thing should get small.

Bootstrapped/regtested i686-linux.  I am testing x86_64-linux and ppc-linux.  OK if it passes?
	* cgraphbuild.c (build_cgraph_edges): Update.
	* tree-pass.h: Update comment.
	* final.c (leaf_function_p): Update.
	(leaf_renumber_regs): Update.
	(rest_of_clean_state): Update.
	* omp-low.c (expand_omp_parallel): Update.
	* ipa-reference.c (analyze_function): Update.
	* reorg.c (find_end_label): Update.
	(optimize_skip): Update.
	(fill_simple_delay_slots): Update.
	(fill_simple_delay_slots): Update.
	(make_return_insns): Update.
	(dbr_schedule): Update.
	* gimple-low.c (record_vars_into): Update.
	* cfgbuild.c (make_edges): Update.
	* function.c (assign_stack_local): Update.
	(assign_parm_adjust_stack_rtl): Update.
	(locate_and_pad_parm): Update.
	(allocate_struct_function): Do not initialize stack_alignment_needed
	and preferred_stack_boundary here.
	(stack_protect_prologue): Update.
	(stack_protect_epilogue): Update.
	(expand_function_start): Initialize stack_alignment_needed,
	preferred_stack_boundary and max_jumptable_ents.
	(expand_function_end): Update.
	(free_after_compilation): Do not NULLify epilogue_delay_list.
	* function.h (struct rtl_data): Add stack_protect_guard, stack_alignment_needed,
	preferred_stack_boundary, epilogue_delay_list.
	(struct function): Remove value_histograms, stack_alignment_needed,
	preferred_stack_boundary, epilogue_delay_list, max_jumptable_ents, last_label_uid,
	unexpanded_var_list, stack_protect_guard.
	(current_function_epilogue_delay_list): Remove.
	(VALUE_HISTOGRAMS): Remove.
	* ipa-type-escape.c (analyze_function): Update.
	* gimplify.c (pop_gimplify_context): Update comment.
	* calls.c (expand_call): Update.
	(emit_library_call_value_1): Update.
	* except.c (set_nothrow_function_flags): Update.
	* cfgexpand.c (get_decl_align_unit): Update.
	(create_stack_guard): Update.
	(estimated_stack_frame_size): Update.
	(expand_used_vars): Update.
	(tree_expand_cfg): Free histogram earliers, init expansion variables.
	* explow.c (allocate_dynamic_stack_space): Update.
	* tree-ssa-live.c (remove_unused_locals): Update.
	* varasm.c (mark_constant_pool): Update.
	* tree-inline.c (remap_decls): Update.
	(initialize_cfun): Update.
	(declare_return_variable): Update.
	(inline_forbidden_p): Update.
	(expand_call_inline): Update.
	(declare_inline_vars): Update.
	(tree_function_versioning): Update.
	* basic-block.h (control_flow_graph): Add max_jumptable_ents, last_label_uid.
	* tree-cfg.c (set_bb_for_stmt): Update.
	(replace_by_duplicate_decl): Update.
	(move_block_to_fn): Update.
	(new_label_mapper): Update.
	(dump_function_to_file): Update.
	* ipa-struct-reorg.c (build_data_structure): Update.
	* cfgrtl.c (print_rtl_with_bb): Update.
	* reload1.c (reload): Update.
	(reload): Update.
	* config/i386/i386.c (setup_incoming_varargs_64,
	ix86_compute_frame_layout): Update.
	* config/arc/arc.c (arc_output_function_epilogue): Update.

Index: cgraphbuild.c
===================================================================
*** cgraphbuild.c	(revision 134086)
--- cgraphbuild.c	(working copy)
*************** build_cgraph_edges (void)
*** 152,158 ****
        }
  
    /* Look for initializers of constant variables and private statics.  */
!   for (step = cfun->unexpanded_var_list;
         step;
         step = TREE_CHAIN (step))
      {
--- 152,158 ----
        }
  
    /* Look for initializers of constant variables and private statics.  */
!   for (step = cfun->local_decls;
         step;
         step = TREE_CHAIN (step))
      {
Index: value-prof.c
===================================================================
*** value-prof.c	(revision 134086)
--- value-prof.c	(working copy)
*************** verify_histograms (void)
*** 366,371 ****
--- 366,373 ----
    histogram_value hist;
    struct pointer_set_t *visited_hists;
  
+   if (!VALUE_HISTOGRAMS (cfun))
+     return;
    error_found = false;
    visited_hists = pointer_set_create ();
    FOR_EACH_BB (bb)
Index: tree-pass.h
===================================================================
*** tree-pass.h	(revision 134086)
--- tree-pass.h	(working copy)
*************** struct dump_file_info
*** 229,236 ****
  #define TODO_update_ssa_only_virtuals	(1 << 14)
  
  /* Some passes leave unused local variables that can be removed from
!    cfun->unexpanded_var_list.  This reduces the size of dump files and
!    the memory footprint for VAR_DECLs.  */
  #define TODO_remove_unused_locals	(1 << 15)
  
  /* Internally used for the first in a sequence of passes.  It is set
--- 229,236 ----
  #define TODO_update_ssa_only_virtuals	(1 << 14)
  
  /* Some passes leave unused local variables that can be removed from
!    cfun->gimple_df->unexpanded_var_list.  This reduces the size of dump files
!    and the memory footprint for VAR_DECLs.  */
  #define TODO_remove_unused_locals	(1 << 15)
  
  /* Internally used for the first in a sequence of passes.  It is set
Index: final.c
===================================================================
*** final.c	(revision 134086)
--- final.c	(working copy)
*************** leaf_function_p (void)
*** 3824,3830 ****
  	  && ! SIBLING_CALL_P (XVECEXP (PATTERN (insn), 0, 0)))
  	return 0;
      }
!   for (link = current_function_epilogue_delay_list;
         link;
         link = XEXP (link, 1))
      {
--- 3824,3830 ----
  	  && ! SIBLING_CALL_P (XVECEXP (PATTERN (insn), 0, 0)))
  	return 0;
      }
!   for (link = crtl->epilogue_delay_list;
         link;
         link = XEXP (link, 1))
      {
*************** leaf_renumber_regs (rtx first)
*** 3908,3914 ****
    for (insn = first; insn; insn = NEXT_INSN (insn))
      if (INSN_P (insn))
        leaf_renumber_regs_insn (PATTERN (insn));
!   for (insn = current_function_epilogue_delay_list;
         insn;
         insn = XEXP (insn, 1))
      if (INSN_P (XEXP (insn, 0)))
--- 3908,3914 ----
    for (insn = first; insn; insn = NEXT_INSN (insn))
      if (INSN_P (insn))
        leaf_renumber_regs_insn (PATTERN (insn));
!   for (insn = crtl->epilogue_delay_list;
         insn;
         insn = XEXP (insn, 1))
      if (INSN_P (XEXP (insn, 0)))
*************** rest_of_clean_state (void)
*** 4236,4244 ****
  
    if (targetm.binds_local_p (current_function_decl))
      {
!       int pref = cfun->preferred_stack_boundary;
!       if (cfun->stack_alignment_needed > cfun->preferred_stack_boundary)
!         pref = cfun->stack_alignment_needed;
        cgraph_rtl_info (current_function_decl)->preferred_incoming_stack_boundary
          = pref;
      }
--- 4236,4244 ----
  
    if (targetm.binds_local_p (current_function_decl))
      {
!       int pref = crtl->preferred_stack_boundary;
!       if (crtl->stack_alignment_needed > crtl->preferred_stack_boundary)
!         pref = crtl->stack_alignment_needed;
        cgraph_rtl_info (current_function_decl)->preferred_incoming_stack_boundary
          = pref;
      }
Index: omp-low.c
===================================================================
*** omp-low.c	(revision 134086)
--- omp-low.c	(working copy)
*************** expand_omp_parallel (struct omp_region *
*** 2626,2632 ****
  
        /* Declare local variables needed in CHILD_CFUN.  */
        block = DECL_INITIAL (child_fn);
!       BLOCK_VARS (block) = list2chain (child_cfun->unexpanded_var_list);
        DECL_SAVED_TREE (child_fn) = bb_stmt_list (single_succ (entry_bb));
  
        /* Reset DECL_CONTEXT on function arguments.  */
--- 2626,2632 ----
  
        /* Declare local variables needed in CHILD_CFUN.  */
        block = DECL_INITIAL (child_fn);
!       BLOCK_VARS (block) = list2chain (child_cfun->local_decls);
        DECL_SAVED_TREE (child_fn) = bb_stmt_list (single_succ (entry_bb));
  
        /* Reset DECL_CONTEXT on function arguments.  */
Index: ipa-reference.c
===================================================================
*** ipa-reference.c	(revision 134086)
--- ipa-reference.c	(working copy)
*************** analyze_function (struct cgraph_node *fn
*** 836,842 ****
    if (DECL_STRUCT_FUNCTION (decl))
      {
        tree step;
!       for (step = DECL_STRUCT_FUNCTION (decl)->unexpanded_var_list;
  	   step;
  	   step = TREE_CHAIN (step))
  	{
--- 836,842 ----
    if (DECL_STRUCT_FUNCTION (decl))
      {
        tree step;
!       for (step = DECL_STRUCT_FUNCTION (decl)->local_decls;
  	   step;
  	   step = TREE_CHAIN (step))
  	{
Index: reorg.c
===================================================================
*** reorg.c	(revision 134086)
--- reorg.c	(working copy)
*************** find_end_label (void)
*** 428,434 ****
  	     epilogue has filled delay-slots; we would have to try and
  	     move the delay-slot fillers to the delay-slots for the new
  	     return insn or in front of the new return insn.  */
! 	  if (current_function_epilogue_delay_list == NULL
  	      && HAVE_return)
  	    {
  	      /* The return we make may have delay slots too.  */
--- 428,434 ----
  	     epilogue has filled delay-slots; we would have to try and
  	     move the delay-slot fillers to the delay-slots for the new
  	     return insn or in front of the new return insn.  */
! 	  if (crtl->epilogue_delay_list == NULL
  	      && HAVE_return)
  	    {
  	      /* The return we make may have delay slots too.  */
*************** optimize_skip (rtx insn)
*** 792,798 ****
       In both of these cases, inverting the jump and annulling the delay
       slot give the same effect in fewer insns.  */
    if ((next_trial == next_active_insn (JUMP_LABEL (insn))
!        && ! (next_trial == 0 && current_function_epilogue_delay_list != 0))
        || (next_trial != 0
  	  && JUMP_P (next_trial)
  	  && JUMP_LABEL (insn) == JUMP_LABEL (next_trial)
--- 792,798 ----
       In both of these cases, inverting the jump and annulling the delay
       slot give the same effect in fewer insns.  */
    if ((next_trial == next_active_insn (JUMP_LABEL (insn))
!        && ! (next_trial == 0 && crtl->epilogue_delay_list != 0))
        || (next_trial != 0
  	  && JUMP_P (next_trial)
  	  && JUMP_LABEL (insn) == JUMP_LABEL (next_trial)
*************** fill_simple_delay_slots (int non_jumps_p
*** 2410,2416 ****
       The only thing we can do is scan backwards from the end of the
       function.  If we did this in a previous pass, it is incorrect to do it
       again.  */
!   if (current_function_epilogue_delay_list)
      return;
  
    slots_to_fill = DELAY_SLOTS_FOR_EPILOGUE;
--- 2410,2416 ----
       The only thing we can do is scan backwards from the end of the
       function.  If we did this in a previous pass, it is incorrect to do it
       again.  */
!   if (crtl->epilogue_delay_list)
      return;
  
    slots_to_fill = DELAY_SLOTS_FOR_EPILOGUE;
*************** fill_simple_delay_slots (int non_jumps_p
*** 2470,2478 ****
  	      /* Here as well we are searching backward, so put the
  		 insns we find on the head of the list.  */
  
! 	      current_function_epilogue_delay_list
  		= gen_rtx_INSN_LIST (VOIDmode, trial,
! 				     current_function_epilogue_delay_list);
  	      mark_end_of_function_resources (trial, 1);
  	      update_block (trial, trial);
  	      delete_related_insns (trial);
--- 2470,2478 ----
  	      /* Here as well we are searching backward, so put the
  		 insns we find on the head of the list.  */
  
! 	      crtl->epilogue_delay_list
  		= gen_rtx_INSN_LIST (VOIDmode, trial,
! 				     crtl->epilogue_delay_list);
  	      mark_end_of_function_resources (trial, 1);
  	      update_block (trial, trial);
  	      delete_related_insns (trial);
*************** make_return_insns (rtx first)
*** 3695,3701 ****
       delay slot filler insns.  It is also unknown whether such a
       transformation would actually be profitable.  Note that the existing
       code only cares for branches with (some) filled delay slots.  */
!   if (current_function_epilogue_delay_list != NULL)
      return;
  #endif
  
--- 3695,3701 ----
       delay slot filler insns.  It is also unknown whether such a
       transformation would actually be profitable.  Note that the existing
       code only cares for branches with (some) filled delay slots.  */
!   if (crtl->epilogue_delay_list != NULL)
      return;
  #endif
  
*************** dbr_schedule (rtx first)
*** 4036,4042 ****
    {
      rtx link;
  
!     for (link = current_function_epilogue_delay_list;
           link;
           link = XEXP (link, 1))
        INSN_LOCATOR (XEXP (link, 0)) = 0;
--- 4036,4042 ----
    {
      rtx link;
  
!     for (link = crtl->epilogue_delay_list;
           link;
           link = XEXP (link, 1))
        INSN_LOCATOR (XEXP (link, 0)) = 0;
Index: gimple-low.c
===================================================================
*** gimple-low.c	(revision 134086)
--- gimple-low.c	(working copy)
*************** record_vars_into (tree vars, tree fn)
*** 736,743 ****
  	continue;
  
        /* Record the variable.  */
!       cfun->unexpanded_var_list = tree_cons (NULL_TREE, var,
! 					     cfun->unexpanded_var_list);
      }
  
    if (fn != current_function_decl)
--- 736,743 ----
  	continue;
  
        /* Record the variable.  */
!       cfun->local_decls = tree_cons (NULL_TREE, var,
! 					     cfun->local_decls);
      }
  
    if (fn != current_function_decl)
Index: expr.c
===================================================================
*** expr.c	(revision 134086)
--- expr.c	(working copy)
*************** do_tablejump (rtx index, enum machine_mo
*** 9923,9930 ****
  {
    rtx temp, vector;
  
!   if (INTVAL (range) > cfun->max_jumptable_ents)
!     cfun->max_jumptable_ents = INTVAL (range);
  
    /* Do an unsigned comparison (in the proper mode) between the index
       expression and the value which represents the length of the range.
--- 9923,9930 ----
  {
    rtx temp, vector;
  
!   if (INTVAL (range) > cfun->cfg->max_jumptable_ents)
!     cfun->cfg->max_jumptable_ents = INTVAL (range);
  
    /* Do an unsigned comparison (in the proper mode) between the index
       expression and the value which represents the length of the range.
Index: cfgbuild.c
===================================================================
*** cfgbuild.c	(revision 134086)
--- cfgbuild.c	(working copy)
*************** make_edges (basic_block min, basic_block
*** 256,262 ****
    /* Heavy use of computed goto in machine-generated code can lead to
       nearly fully-connected CFGs.  In that case we spend a significant
       amount of time searching the edge lists for duplicates.  */
!   if (forced_labels || cfun->max_jumptable_ents > 100)
      edge_cache = sbitmap_alloc (last_basic_block);
  
    /* By nature of the way these get numbered, ENTRY_BLOCK_PTR->next_bb block
--- 256,262 ----
    /* Heavy use of computed goto in machine-generated code can lead to
       nearly fully-connected CFGs.  In that case we spend a significant
       amount of time searching the edge lists for duplicates.  */
!   if (forced_labels || cfun->cfg->max_jumptable_ents > 100)
      edge_cache = sbitmap_alloc (last_basic_block);
  
    /* By nature of the way these get numbered, ENTRY_BLOCK_PTR->next_bb block
Index: function.c
===================================================================
*** function.c	(revision 134087)
--- function.c	(working copy)
*************** free_after_compilation (struct function 
*** 288,295 ****
    f->eh = NULL;
    f->machine = NULL;
    f->cfg = NULL;
- 
-   f->epilogue_delay_list = NULL;
  }
  
  /* Return size needed for stack frame based on slots so far allocated.
--- 288,293 ----
*************** assign_stack_local (enum machine_mode mo
*** 378,385 ****
    if (alignment * BITS_PER_UNIT > PREFERRED_STACK_BOUNDARY)
      alignment = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
  
!   if (cfun->stack_alignment_needed < alignment * BITS_PER_UNIT)
!     cfun->stack_alignment_needed = alignment * BITS_PER_UNIT;
  
    /* Calculate how many bytes the start of local variables is off from
       stack alignment.  */
--- 376,383 ----
    if (alignment * BITS_PER_UNIT > PREFERRED_STACK_BOUNDARY)
      alignment = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
  
!   if (crtl->stack_alignment_needed < alignment * BITS_PER_UNIT)
!     crtl->stack_alignment_needed = alignment * BITS_PER_UNIT;
  
    /* Calculate how many bytes the start of local variables is off from
       stack alignment.  */
*************** assign_parm_adjust_stack_rtl (struct ass
*** 2378,2384 ****
  
    /* If stack protection is in effect for this function, don't leave any
       pointers in their passed stack slots.  */
!   else if (cfun->stack_protect_guard
  	   && (flag_stack_protect == 2
  	       || data->passed_pointer
  	       || POINTER_TYPE_P (data->nominal_type)))
--- 2376,2382 ----
  
    /* If stack protection is in effect for this function, don't leave any
       pointers in their passed stack slots.  */
!   else if (crtl->stack_protect_guard
  	   && (flag_stack_protect == 2
  	       || data->passed_pointer
  	       || POINTER_TYPE_P (data->nominal_type)))
*************** locate_and_pad_parm (enum machine_mode p
*** 3285,3292 ****
       calling function side.  */
    if (boundary > PREFERRED_STACK_BOUNDARY)
      boundary = PREFERRED_STACK_BOUNDARY;
!   if (cfun->stack_alignment_needed < boundary)
!     cfun->stack_alignment_needed = boundary;
  
  #ifdef ARGS_GROW_DOWNWARD
    locate->slot_offset.constant = -initial_offset_ptr->constant;
--- 3283,3290 ----
       calling function side.  */
    if (boundary > PREFERRED_STACK_BOUNDARY)
      boundary = PREFERRED_STACK_BOUNDARY;
!   if (crtl->stack_alignment_needed < boundary)
!     crtl->stack_alignment_needed = boundary;
  
  #ifdef ARGS_GROW_DOWNWARD
    locate->slot_offset.constant = -initial_offset_ptr->constant;
*************** allocate_struct_function (tree fndecl, b
*** 3841,3849 ****
  
    cfun = ggc_alloc_cleared (sizeof (struct function));
  
-   cfun->stack_alignment_needed = STACK_BOUNDARY;
-   cfun->preferred_stack_boundary = STACK_BOUNDARY;
- 
    current_function_funcdef_no = get_next_funcdef_no ();
  
    cfun->function_frequency = FUNCTION_FREQUENCY_NORMAL;
--- 3839,3844 ----
*************** stack_protect_prologue (void)
*** 4019,4027 ****
  
    /* Avoid expand_expr here, because we don't want guard_decl pulled
       into registers unless absolutely necessary.  And we know that
!      cfun->stack_protect_guard is a local stack slot, so this skips
       all the fluff.  */
!   x = validize_mem (DECL_RTL (cfun->stack_protect_guard));
    y = validize_mem (DECL_RTL (guard_decl));
  
    /* Allow the target to copy from Y to X without leaking Y into a
--- 4014,4022 ----
  
    /* Avoid expand_expr here, because we don't want guard_decl pulled
       into registers unless absolutely necessary.  And we know that
!      crtl->stack_protect_guard is a local stack slot, so this skips
       all the fluff.  */
!   x = validize_mem (DECL_RTL (crtl->stack_protect_guard));
    y = validize_mem (DECL_RTL (guard_decl));
  
    /* Allow the target to copy from Y to X without leaking Y into a
*************** stack_protect_epilogue (void)
*** 4057,4065 ****
  
    /* Avoid expand_expr here, because we don't want guard_decl pulled
       into registers unless absolutely necessary.  And we know that
!      cfun->stack_protect_guard is a local stack slot, so this skips
       all the fluff.  */
!   x = validize_mem (DECL_RTL (cfun->stack_protect_guard));
    y = validize_mem (DECL_RTL (guard_decl));
  
    /* Allow the target to compare Y with X without leaking either into
--- 4052,4060 ----
  
    /* Avoid expand_expr here, because we don't want guard_decl pulled
       into registers unless absolutely necessary.  And we know that
!      crtl->stack_protect_guard is a local stack slot, so this skips
       all the fluff.  */
!   x = validize_mem (DECL_RTL (crtl->stack_protect_guard));
    y = validize_mem (DECL_RTL (guard_decl));
  
    /* Allow the target to compare Y with X without leaking either into
*************** expand_function_start (tree subr)
*** 4106,4111 ****
--- 4101,4110 ----
       valid operands of arithmetic insns.  */
    init_recog_no_volatile ();
  
+   crtl->stack_alignment_needed = STACK_BOUNDARY;
+   crtl->preferred_stack_boundary = STACK_BOUNDARY;
+   cfun->cfg->max_jumptable_ents = 0;
+ 
    current_function_profile
      = (profile_flag
         && ! DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (subr));
*************** expand_function_end (void)
*** 4580,4586 ****
      emit_insn (gen_blockage ());
  
    /* If stack protection is enabled for this function, check the guard.  */
!   if (cfun->stack_protect_guard)
      stack_protect_epilogue ();
  
    /* If we had calls to alloca, and this machine needs
--- 4579,4585 ----
      emit_insn (gen_blockage ());
  
    /* If stack protection is enabled for this function, check the guard.  */
!   if (crtl->stack_protect_guard)
      stack_protect_epilogue ();
  
    /* If we had calls to alloca, and this machine needs
Index: function.h
===================================================================
*** function.h	(revision 134087)
--- function.h	(working copy)
*************** struct rtl_data GTY(())
*** 244,249 ****
--- 244,253 ----
       has_hard_reg_initial_val (see integrate.[hc]).  */
    struct initial_value_struct *hard_reg_initial_vals;
  
+   /* A variable living at the top of the frame that holds a known value.
+      Used for detecting stack clobbers.  */
+   tree stack_protect_guard;
+ 
    /* List (chain of EXPR_LIST) of labels heading the current handlers for
       nonlocal gotos.  */
    rtx x_nonlocal_goto_handler_labels;
*************** struct rtl_data GTY(())
*** 259,265 ****
    rtx x_naked_return_label;
  
    /* List (chain of EXPR_LISTs) of all stack slots in this function.
!      Made for the sake of unshare_all_crtl->  */
    rtx x_stack_slot_list;
  
    /* Place after which to insert the tail_recursion_label if we need one.  */
--- 263,269 ----
    rtx x_naked_return_label;
  
    /* List (chain of EXPR_LISTs) of all stack slots in this function.
!      Made for the sake of unshare_all_rtl.  */
    rtx x_stack_slot_list;
  
    /* Place after which to insert the tail_recursion_label if we need one.  */
*************** struct rtl_data GTY(())
*** 288,293 ****
--- 292,308 ----
    /* Current nesting level for temporaries.  */
    int x_temp_slot_level;
  
+   /* The largest alignment of slot allocated on the stack.  */
+   unsigned int stack_alignment_needed;
+ 
+   /* Preferred alignment of the end of stack frame.  */
+   unsigned int preferred_stack_boundary;
+ 
+   /* For reorg.  */
+ 
+   /* If some insns can be deferred to the delay slots of the epilogue, the
+      delay list for them is recorded here.  */
+   rtx epilogue_delay_list;
  };
  
  #define return_label (crtl->x_return_label)
*************** struct function GTY(())
*** 347,392 ****
    /* Function sequence number for profiling, debugging, etc.  */
    int funcdef_no;
  
    /* For md files.  */
  
    /* tm.h can use this to store whatever it likes.  */
    struct machine_function * GTY ((maybe_undef)) machine;
  
-   /* The largest alignment of slot allocated on the stack.  */
-   unsigned int stack_alignment_needed;
- 
-   /* Preferred alignment of the end of stack frame.  */
-   unsigned int preferred_stack_boundary;
- 
    /* Language-specific code can use this to store whatever it likes.  */
    struct language_function * language;
  
    /* Used types hash table.  */
    htab_t GTY ((param_is (union tree_node))) used_types_hash;
  
-   /* For reorg.  */
- 
-   /* If some insns can be deferred to the delay slots of the epilogue, the
-      delay list for them is recorded here.  */
-   rtx epilogue_delay_list;
- 
-   /* Maximal number of entities in the single jumptable.  Used to estimate
-      final flowgraph size.  */
-   int max_jumptable_ents;
- 
-   /* UIDs for LABEL_DECLs.  */
-   int last_label_uid;
- 
    /* Line number of the end of the function.  */
    location_t function_end_locus;
  
-   /* The variables unexpanded so far.  */
-   tree unexpanded_var_list;
- 
-   /* A variable living at the top of the frame that holds a known value.
-      Used for detecting stack clobbers.  */
-   tree stack_protect_guard;
- 
    /* Properties used by the pass manager.  */
    unsigned int curr_properties;
    unsigned int last_verified;
--- 362,384 ----
    /* Function sequence number for profiling, debugging, etc.  */
    int funcdef_no;
  
+   /* List of function local variables, functions, types and constants.  */
+   tree local_decls;
+ 
    /* For md files.  */
  
    /* tm.h can use this to store whatever it likes.  */
    struct machine_function * GTY ((maybe_undef)) machine;
  
    /* Language-specific code can use this to store whatever it likes.  */
    struct language_function * language;
  
    /* Used types hash table.  */
    htab_t GTY ((param_is (union tree_node))) used_types_hash;
  
    /* Line number of the end of the function.  */
    location_t function_end_locus;
  
    /* Properties used by the pass manager.  */
    unsigned int curr_properties;
    unsigned int last_verified;
*************** extern void instantiate_decl_rtl (rtx x)
*** 553,559 ****
  #define current_function_limit_stack (cfun->limit_stack)
  #define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table)
  #define current_function_uses_const_pool (cfun->uses_const_pool)
- #define current_function_epilogue_delay_list (cfun->epilogue_delay_list)
  #define current_function_has_nonlocal_label (cfun->has_nonlocal_label)
  #define current_function_saves_all_registers (cfun->saves_all_registers)
  #define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto)
--- 545,550 ----
Index: ipa-type-escape.c
===================================================================
*** ipa-type-escape.c	(revision 134086)
--- ipa-type-escape.c	(working copy)
*************** analyze_function (struct cgraph_node *fn
*** 1752,1758 ****
    if (DECL_STRUCT_FUNCTION (decl))
      {
        tree step;
!       for (step = DECL_STRUCT_FUNCTION (decl)->unexpanded_var_list;
  	   step;
  	   step = TREE_CHAIN (step))
  	{
--- 1752,1758 ----
    if (DECL_STRUCT_FUNCTION (decl))
      {
        tree step;
!       for (step = DECL_STRUCT_FUNCTION (decl)->local_decls;
  	   step;
  	   step = TREE_CHAIN (step))
  	{
Index: gimplify.c
===================================================================
*** gimplify.c	(revision 134086)
--- gimplify.c	(working copy)
*************** push_gimplify_context (void)
*** 175,181 ****
  
  /* Tear down a context for the gimplifier.  If BODY is non-null, then
     put the temporaries into the outer BIND_EXPR.  Otherwise, put them
!    in the unexpanded_var_list.  */
  
  void
  pop_gimplify_context (tree body)
--- 175,181 ----
  
  /* Tear down a context for the gimplifier.  If BODY is non-null, then
     put the temporaries into the outer BIND_EXPR.  Otherwise, put them
!    in the local_decls.  */
  
  void
  pop_gimplify_context (tree body)
Index: calls.c
===================================================================
*** calls.c	(revision 134087)
--- calls.c	(working copy)
*************** expand_call (tree exp, rtx target, int i
*** 2297,2305 ****
    /* Ensure current function's preferred stack boundary is at least
       what we need.  We don't have to increase alignment for recursive
       functions.  */
!   if (cfun->preferred_stack_boundary < preferred_stack_boundary
        && fndecl != current_function_decl)
!     cfun->preferred_stack_boundary = preferred_stack_boundary;
    if (fndecl == current_function_decl)
      cfun->recursive_call_emit = true;
  
--- 2297,2305 ----
    /* Ensure current function's preferred stack boundary is at least
       what we need.  We don't have to increase alignment for recursive
       functions.  */
!   if (crtl->preferred_stack_boundary < preferred_stack_boundary
        && fndecl != current_function_decl)
!     crtl->preferred_stack_boundary = preferred_stack_boundary;
    if (fndecl == current_function_decl)
      cfun->recursive_call_emit = true;
  
*************** expand_call (tree exp, rtx target, int i
*** 2371,2377 ****
        if (pass && (flags & (ECF_LIBCALL_BLOCK | ECF_MALLOC)))
  	start_sequence ();
  
!       if (pass == 0 && cfun->stack_protect_guard)
  	stack_protect_epilogue ();
  
        adjusted_args_size = args_size;
--- 2371,2377 ----
        if (pass && (flags & (ECF_LIBCALL_BLOCK | ECF_MALLOC)))
  	start_sequence ();
  
!       if (pass == 0 && crtl->stack_protect_guard)
  	stack_protect_epilogue ();
  
        adjusted_args_size = args_size;
*************** emit_library_call_value_1 (int retval, r
*** 3347,3354 ****
  
    /* Ensure current function's preferred stack boundary is at least
       what we need.  */
!   if (cfun->preferred_stack_boundary < PREFERRED_STACK_BOUNDARY)
!     cfun->preferred_stack_boundary = PREFERRED_STACK_BOUNDARY;
  
    /* If this kind of value comes back in memory,
       decide where in memory it should come back.  */
--- 3347,3354 ----
  
    /* Ensure current function's preferred stack boundary is at least
       what we need.  */
!   if (crtl->preferred_stack_boundary < PREFERRED_STACK_BOUNDARY)
!     crtl->preferred_stack_boundary = PREFERRED_STACK_BOUNDARY;
  
    /* If this kind of value comes back in memory,
       decide where in memory it should come back.  */
Index: except.c
===================================================================
*** except.c	(revision 134086)
--- except.c	(working copy)
*************** set_nothrow_function_flags (void)
*** 2828,2834 ****
  	  }
        }
  
!   for (insn = current_function_epilogue_delay_list; insn;
         insn = XEXP (insn, 1))
      if (can_throw_external (insn))
        {
--- 2828,2834 ----
  	  }
        }
  
!   for (insn = crtl->epilogue_delay_list; insn;
         insn = XEXP (insn, 1))
      if (can_throw_external (insn))
        {
Index: cfgexpand.c
===================================================================
*** cfgexpand.c	(revision 134086)
--- cfgexpand.c	(working copy)
*************** get_decl_align_unit (tree decl)
*** 163,170 ****
    align = LOCAL_ALIGNMENT (TREE_TYPE (decl), align);
    if (align > PREFERRED_STACK_BOUNDARY)
      align = PREFERRED_STACK_BOUNDARY;
!   if (cfun->stack_alignment_needed < align)
!     cfun->stack_alignment_needed = align;
  
    return align / BITS_PER_UNIT;
  }
--- 163,170 ----
    align = LOCAL_ALIGNMENT (TREE_TYPE (decl), align);
    if (align > PREFERRED_STACK_BOUNDARY)
      align = PREFERRED_STACK_BOUNDARY;
!   if (crtl->stack_alignment_needed < align)
!     crtl->stack_alignment_needed = align;
  
    return align / BITS_PER_UNIT;
  }
*************** create_stack_guard (void)
*** 978,984 ****
    TREE_THIS_VOLATILE (guard) = 1;
    TREE_USED (guard) = 1;
    expand_one_stack_var (guard);
!   cfun->stack_protect_guard = guard;
  }
  
  /* A subroutine of expand_used_vars.  Walk down through the BLOCK tree
--- 978,984 ----
    TREE_THIS_VOLATILE (guard) = 1;
    TREE_USED (guard) = 1;
    expand_one_stack_var (guard);
!   crtl->stack_protect_guard = guard;
  }
  
  /* A subroutine of expand_used_vars.  Walk down through the BLOCK tree
*************** static void 
*** 1029,1036 ****
  init_vars_expansion (void)
  {
    tree t;
!   /* Set TREE_USED on all variables in the unexpanded_var_list.  */
!   for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t))
      TREE_USED (TREE_VALUE (t)) = 1;
  
    /* Clear TREE_USED on all variables associated with a block scope.  */
--- 1029,1036 ----
  init_vars_expansion (void)
  {
    tree t;
!   /* Set TREE_USED on all variables in the local_decls.  */
!   for (t = cfun->local_decls; t; t = TREE_CHAIN (t))
      TREE_USED (TREE_VALUE (t)) = 1;
  
    /* Clear TREE_USED on all variables associated with a block scope.  */
*************** estimated_stack_frame_size (void)
*** 1062,1070 ****
  
    init_vars_expansion ();
  
!   /* At this point all variables on the unexpanded_var_list with TREE_USED
       set are not associated with any block scope.  Lay them out.  */
!   for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t))
      {
        tree var = TREE_VALUE (t);
  
--- 1062,1070 ----
  
    init_vars_expansion ();
  
!   /* At this point all variables on the local_decls with TREE_USED
       set are not associated with any block scope.  Lay them out.  */
!   for (t = cfun->local_decls; t; t = TREE_CHAIN (t))
      {
        tree var = TREE_VALUE (t);
  
*************** expand_used_vars (void)
*** 1113,1121 ****
  
    init_vars_expansion ();
  
!   /* At this point all variables on the unexpanded_var_list with TREE_USED
       set are not associated with any block scope.  Lay them out.  */
!   for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t))
      {
        tree var = TREE_VALUE (t);
        bool expand_now = false;
--- 1113,1121 ----
  
    init_vars_expansion ();
  
!   /* At this point all variables on the local_decls with TREE_USED
       set are not associated with any block scope.  Lay them out.  */
!   for (t = cfun->local_decls; t; t = TREE_CHAIN (t))
      {
        tree var = TREE_VALUE (t);
        bool expand_now = false;
*************** expand_used_vars (void)
*** 1148,1154 ****
        if (expand_now)
  	expand_one_var (var, true, true);
      }
!   cfun->unexpanded_var_list = NULL_TREE;
  
    /* At this point, all variables within the block tree with TREE_USED
       set are actually used by the optimized function.  Lay them out.  */
--- 1148,1154 ----
        if (expand_now)
  	expand_one_var (var, true, true);
      }
!   cfun->local_decls = NULL_TREE;
  
    /* At this point, all variables within the block tree with TREE_USED
       set are actually used by the optimized function.  Lay them out.  */
*************** tree_expand_cfg (void)
*** 1873,1879 ****
        if (current_function_calls_alloca)
  	warning (OPT_Wstack_protector, 
  		 "not protecting local variables: variable length buffer");
!       if (has_short_buffer && !cfun->stack_protect_guard)
  	warning (OPT_Wstack_protector, 
  		 "not protecting function: no buffer at least %d bytes long",
  		 (int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE));
--- 1873,1879 ----
        if (current_function_calls_alloca)
  	warning (OPT_Wstack_protector, 
  		 "not protecting local variables: variable length buffer");
!       if (has_short_buffer && !crtl->stack_protect_guard)
  	warning (OPT_Wstack_protector, 
  		 "not protecting function: no buffer at least %d bytes long",
  		 (int) PARAM_VALUE (PARAM_SSP_BUFFER_SIZE));
*************** tree_expand_cfg (void)
*** 1891,1897 ****
  
    /* Initialize the stack_protect_guard field.  This must happen after the
       call to __main (if any) so that the external decl is initialized.  */
!   if (cfun->stack_protect_guard)
      stack_protect_prologue ();
  
    /* Register rtl specific functions for cfg.  */
--- 1891,1897 ----
  
    /* Initialize the stack_protect_guard field.  This must happen after the
       call to __main (if any) so that the external decl is initialized.  */
!   if (crtl->stack_protect_guard)
      stack_protect_prologue ();
  
    /* Register rtl specific functions for cfg.  */
*************** tree_expand_cfg (void)
*** 1908,1913 ****
--- 1908,1914 ----
    FOR_BB_BETWEEN (bb, init_block->next_bb, EXIT_BLOCK_PTR, next_bb)
      bb = expand_gimple_basic_block (bb);
    pointer_map_destroy (lab_rtx_for_bb);
+   free_histograms ();
  
    construct_exit_block ();
    set_curr_insn_block (DECL_INITIAL (current_function_decl));
*************** tree_expand_cfg (void)
*** 1971,1977 ****
    /* After expanding, the return labels are no longer needed. */
    return_label = NULL;
    naked_return_label = NULL;
-   free_histograms ();
    /* Tag the blocks with a depth number so that change_scope can find
       the common parent easily.  */
    set_block_levels (DECL_INITIAL (cfun->decl), 0);
--- 1972,1977 ----
Index: explow.c
===================================================================
*** explow.c	(revision 134086)
--- explow.c	(working copy)
*************** allocate_dynamic_stack_space (rtx size, 
*** 1090,1096 ****
    /* We can't attempt to minimize alignment necessary, because we don't
       know the final value of preferred_stack_boundary yet while executing
       this code.  */
!   cfun->preferred_stack_boundary = PREFERRED_STACK_BOUNDARY;
  
    /* We will need to ensure that the address we return is aligned to
       BIGGEST_ALIGNMENT.  If STACK_DYNAMIC_OFFSET is defined, we don't
--- 1090,1096 ----
    /* We can't attempt to minimize alignment necessary, because we don't
       know the final value of preferred_stack_boundary yet while executing
       this code.  */
!   crtl->preferred_stack_boundary = PREFERRED_STACK_BOUNDARY;
  
    /* We will need to ensure that the address we return is aligned to
       BIGGEST_ALIGNMENT.  If STACK_DYNAMIC_OFFSET is defined, we don't
Index: tree-ssa-live.c
===================================================================
*** tree-ssa-live.c	(revision 134086)
--- tree-ssa-live.c	(working copy)
*************** remove_unused_locals (void)
*** 616,623 ****
          }
      }
  
!   /* Remove unmarked local vars from unexpanded_var_list.  */
!   for (cell = &cfun->unexpanded_var_list; *cell; )
      {
        tree var = TREE_VALUE (*cell);
  
--- 616,623 ----
          }
      }
  
!   /* Remove unmarked local vars from local_decls.  */
!   for (cell = &cfun->local_decls; *cell; )
      {
        tree var = TREE_VALUE (*cell);
  
*************** remove_unused_locals (void)
*** 640,649 ****
        cell = &TREE_CHAIN (*cell);
      }
  
!   /* Remove unmarked global vars from unexpanded_var_list.  */
    if (global_unused_vars != NULL)
      {
!       for (t = cfun->unexpanded_var_list; t; t = TREE_CHAIN (t))
  	{
  	  tree var = TREE_VALUE (t);
  
--- 640,649 ----
        cell = &TREE_CHAIN (*cell);
      }
  
!   /* Remove unmarked global vars from local_decls.  */
    if (global_unused_vars != NULL)
      {
!       for (t = cfun->local_decls; t; t = TREE_CHAIN (t))
  	{
  	  tree var = TREE_VALUE (t);
  
*************** remove_unused_locals (void)
*** 654,660 ****
  	    mark_all_vars_used (&DECL_INITIAL (var), global_unused_vars);
  	}
  
!       for (cell = &cfun->unexpanded_var_list; *cell; )
  	{
  	  tree var = TREE_VALUE (*cell);
  
--- 654,660 ----
  	    mark_all_vars_used (&DECL_INITIAL (var), global_unused_vars);
  	}
  
!       for (cell = &cfun->local_decls; *cell; )
  	{
  	  tree var = TREE_VALUE (*cell);
  
Index: varasm.c
===================================================================
*** varasm.c	(revision 134087)
--- varasm.c	(working copy)
*************** mark_constant_pool (void)
*** 3809,3815 ****
    for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
      mark_constants (insn);
  
!   for (link = current_function_epilogue_delay_list;
         link;
         link = XEXP (link, 1))
      mark_constants (XEXP (link, 0));
--- 3809,3815 ----
    for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
      mark_constants (insn);
  
!   for (link = crtl->epilogue_delay_list;
         link;
         link = XEXP (link, 1))
      mark_constants (XEXP (link, 0));
Index: tree-inline.c
===================================================================
*** tree-inline.c	(revision 134086)
--- tree-inline.c	(working copy)
*************** remap_decls (tree decls, copy_body_data 
*** 442,455 ****
      {
        tree new_var;
  
!       /* We can not chain the local static declarations into the unexpanded_var_list
           as we can't duplicate them or break one decl rule.  Go ahead and link
!          them into unexpanded_var_list.  */
        if (!auto_var_in_fn_p (old_var, id->src_fn)
  	  && !DECL_EXTERNAL (old_var))
  	{
! 	  cfun->unexpanded_var_list = tree_cons (NULL_TREE, old_var,
! 						 cfun->unexpanded_var_list);
  	  continue;
  	}
  
--- 442,455 ----
      {
        tree new_var;
  
!       /* We can not chain the local static declarations into the local_decls
           as we can't duplicate them or break one decl rule.  Go ahead and link
!          them into local_decls.  */
        if (!auto_var_in_fn_p (old_var, id->src_fn)
  	  && !DECL_EXTERNAL (old_var))
  	{
! 	  cfun->local_decls = tree_cons (NULL_TREE, old_var,
! 						 cfun->local_decls);
  	  continue;
  	}
  
*************** initialize_cfun (tree new_fndecl, tree c
*** 1277,1283 ****
    *new_cfun = *DECL_STRUCT_FUNCTION (callee_fndecl);
    new_cfun->funcdef_no = get_next_funcdef_no ();
    VALUE_HISTOGRAMS (new_cfun) = NULL;
!   new_cfun->unexpanded_var_list = NULL;
    new_cfun->cfg = NULL;
    new_cfun->decl = new_fndecl /*= copy_node (callee_fndecl)*/;
    DECL_STRUCT_FUNCTION (new_fndecl) = new_cfun;
--- 1277,1283 ----
    *new_cfun = *DECL_STRUCT_FUNCTION (callee_fndecl);
    new_cfun->funcdef_no = get_next_funcdef_no ();
    VALUE_HISTOGRAMS (new_cfun) = NULL;
!   new_cfun->local_decls = NULL;
    new_cfun->cfg = NULL;
    new_cfun->decl = new_fndecl /*= copy_node (callee_fndecl)*/;
    DECL_STRUCT_FUNCTION (new_fndecl) = new_cfun;
*************** declare_return_variable (copy_body_data 
*** 1811,1819 ****
      }
  
    DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
!   DECL_STRUCT_FUNCTION (caller)->unexpanded_var_list
      = tree_cons (NULL_TREE, var,
! 		 DECL_STRUCT_FUNCTION (caller)->unexpanded_var_list);
  
    /* Do not have the rest of GCC warn about this variable as it should
       not be visible to the user.  */
--- 1811,1819 ----
      }
  
    DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
!   DECL_STRUCT_FUNCTION (caller)->local_decls
      = tree_cons (NULL_TREE, var,
! 		 DECL_STRUCT_FUNCTION (caller)->local_decls);
  
    /* Do not have the rest of GCC warn about this variable as it should
       not be visible to the user.  */
*************** inline_forbidden_p (tree fndecl)
*** 2040,2046 ****
  	  goto egress;
        }
  
!   for (step = fun->unexpanded_var_list; step; step = TREE_CHAIN (step))
      {
        tree decl = TREE_VALUE (step);
        if (TREE_CODE (decl) == VAR_DECL
--- 2040,2046 ----
  	  goto egress;
        }
  
!   for (step = fun->local_decls; step; step = TREE_CHAIN (step))
      {
        tree decl = TREE_VALUE (step);
        if (TREE_CODE (decl) == VAR_DECL
*************** expand_call_inline (basic_block bb, tree
*** 2831,2846 ****
    copy_body (id, bb->count, bb->frequency, bb, return_block);
  
    /* Add local vars in this inlined callee to caller.  */
!   t_step = id->src_cfun->unexpanded_var_list;
    for (; t_step; t_step = TREE_CHAIN (t_step))
      {
        var = TREE_VALUE (t_step);
        if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
! 	cfun->unexpanded_var_list = tree_cons (NULL_TREE, var,
! 					       cfun->unexpanded_var_list);
        else
! 	cfun->unexpanded_var_list = tree_cons (NULL_TREE, remap_decl (var, id),
! 					       cfun->unexpanded_var_list);
      }
  
    /* Clean up.  */
--- 2831,2846 ----
    copy_body (id, bb->count, bb->frequency, bb, return_block);
  
    /* Add local vars in this inlined callee to caller.  */
!   t_step = id->src_cfun->local_decls;
    for (; t_step; t_step = TREE_CHAIN (t_step))
      {
        var = TREE_VALUE (t_step);
        if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
! 	cfun->local_decls = tree_cons (NULL_TREE, var,
! 					       cfun->local_decls);
        else
! 	cfun->local_decls = tree_cons (NULL_TREE, remap_decl (var, id),
! 					       cfun->local_decls);
      }
  
    /* Clean up.  */
*************** declare_inline_vars (tree block, tree va
*** 3340,3348 ****
      {
        DECL_SEEN_IN_BIND_EXPR_P (t) = 1;
        gcc_assert (!TREE_STATIC (t) && !TREE_ASM_WRITTEN (t));
!       cfun->unexpanded_var_list =
! 	tree_cons (NULL_TREE, t,
! 		   cfun->unexpanded_var_list);
      }
  
    if (block)
--- 3340,3346 ----
      {
        DECL_SEEN_IN_BIND_EXPR_P (t) = 1;
        gcc_assert (!TREE_STATIC (t) && !TREE_ASM_WRITTEN (t));
!       cfun->local_decls = tree_cons (NULL_TREE, t, cfun->local_decls);
      }
  
    if (block)
*************** tree_function_versioning (tree old_decl,
*** 3615,3633 ****
    /* Renumber the lexical scoping (non-code) blocks consecutively.  */
    number_blocks (id.dst_fn);
    
!   if (DECL_STRUCT_FUNCTION (old_decl)->unexpanded_var_list != NULL_TREE)
      /* Add local vars.  */
!     for (t_step = DECL_STRUCT_FUNCTION (old_decl)->unexpanded_var_list;
  	 t_step; t_step = TREE_CHAIN (t_step))
        {
  	tree var = TREE_VALUE (t_step);
  	if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
! 	  cfun->unexpanded_var_list = tree_cons (NULL_TREE, var,
! 						 cfun->unexpanded_var_list);
  	else
! 	  cfun->unexpanded_var_list =
  	    tree_cons (NULL_TREE, remap_decl (var, &id),
! 		       cfun->unexpanded_var_list);
        }
    
    /* Copy the Function's body.  */
--- 3613,3630 ----
    /* Renumber the lexical scoping (non-code) blocks consecutively.  */
    number_blocks (id.dst_fn);
    
!   if (DECL_STRUCT_FUNCTION (old_decl)->local_decls != NULL_TREE)
      /* Add local vars.  */
!     for (t_step = DECL_STRUCT_FUNCTION (old_decl)->local_decls;
  	 t_step; t_step = TREE_CHAIN (t_step))
        {
  	tree var = TREE_VALUE (t_step);
  	if (TREE_STATIC (var) && !TREE_ASM_WRITTEN (var))
! 	  cfun->local_decls = tree_cons (NULL_TREE, var, cfun->local_decls);
  	else
! 	  cfun->local_decls =
  	    tree_cons (NULL_TREE, remap_decl (var, &id),
! 		       cfun->local_decls);
        }
    
    /* Copy the Function's body.  */
Index: basic-block.h
===================================================================
*** basic-block.h	(revision 134086)
--- basic-block.h	(working copy)
*************** struct control_flow_graph GTY(())
*** 397,402 ****
--- 397,409 ----
  
    /* Number of basic blocks in the dominance tree.  */
    unsigned x_n_bbs_in_dom_tree[2];
+ 
+   /* Maximal number of entities in the single jumptable.  Used to estimate
+      final flowgraph size.  */
+   int max_jumptable_ents;
+ 
+   /* UIDs for LABEL_DECLs.  */
+   int last_label_uid;
  };
  
  /* Defines for accessing the fields of the CFG structure for function FN.  */
Index: tree-cfg.c
===================================================================
*** tree-cfg.c	(revision 134086)
--- tree-cfg.c	(working copy)
*************** set_bb_for_stmt (tree t, basic_block bb)
*** 2697,2703 ****
  	  if (uid == -1)
  	    {
  	      unsigned old_len = VEC_length (basic_block, label_to_block_map);
! 	      LABEL_DECL_UID (t) = uid = cfun->last_label_uid++;
  	      if (old_len <= (unsigned) uid)
  		{
  		  unsigned new_len = 3 * uid / 2;
--- 2697,2703 ----
  	  if (uid == -1)
  	    {
  	      unsigned old_len = VEC_length (basic_block, label_to_block_map);
! 	      LABEL_DECL_UID (t) = uid = cfun->cfg->last_label_uid++;
  	      if (old_len <= (unsigned) uid)
  		{
  		  unsigned new_len = 3 * uid / 2;
*************** replace_by_duplicate_decl (tree *tp, str
*** 5543,5550 ****
        if (SSA_VAR_P (t))
  	{
  	  new_t = copy_var_decl (t, DECL_NAME (t), TREE_TYPE (t));
! 	  f->unexpanded_var_list
! 		  = tree_cons (NULL_TREE, new_t, f->unexpanded_var_list);
  	}
        else
  	{
--- 5543,5549 ----
        if (SSA_VAR_P (t))
  	{
  	  new_t = copy_var_decl (t, DECL_NAME (t), TREE_TYPE (t));
! 	  f->local_decls = tree_cons (NULL_TREE, new_t, f->local_decls);
  	}
        else
  	{
*************** move_block_to_fn (struct function *dest_
*** 5837,5844 ****
  
  	  gcc_assert (DECL_CONTEXT (label) == dest_cfun->decl);
  
! 	  if (uid >= dest_cfun->last_label_uid)
! 	    dest_cfun->last_label_uid = uid + 1;
  	}
        else if (TREE_CODE (stmt) == RESX_EXPR && eh_offset != 0)
  	TREE_OPERAND (stmt, 0) =
--- 5836,5843 ----
  
  	  gcc_assert (DECL_CONTEXT (label) == dest_cfun->decl);
  
! 	  if (uid >= dest_cfun->cfg->last_label_uid)
! 	    dest_cfun->cfg->last_label_uid = uid + 1;
  	}
        else if (TREE_CODE (stmt) == RESX_EXPR && eh_offset != 0)
  	TREE_OPERAND (stmt, 0) =
*************** new_label_mapper (tree decl, void *data)
*** 5911,5918 ****
    m->base.from = decl;
    m->to = create_artificial_label ();
    LABEL_DECL_UID (m->to) = LABEL_DECL_UID (decl);
!   if (LABEL_DECL_UID (m->to) >= cfun->last_label_uid)
!     cfun->last_label_uid = LABEL_DECL_UID (m->to) + 1;
  
    slot = htab_find_slot_with_hash (hash, m, m->hash, INSERT);
    gcc_assert (*slot == NULL);
--- 5910,5917 ----
    m->base.from = decl;
    m->to = create_artificial_label ();
    LABEL_DECL_UID (m->to) = LABEL_DECL_UID (decl);
!   if (LABEL_DECL_UID (m->to) >= cfun->cfg->last_label_uid)
!     cfun->cfg->last_label_uid = LABEL_DECL_UID (m->to) + 1;
  
    slot = htab_find_slot_with_hash (hash, m, m->hash, INSERT);
    gcc_assert (*slot == NULL);
*************** dump_function_to_file (tree fn, FILE *fi
*** 6152,6163 ****
  
    /* When GIMPLE is lowered, the variables are no longer available in
       BIND_EXPRs, so display them separately.  */
!   if (cfun && cfun->decl == fn && cfun->unexpanded_var_list)
      {
        ignore_topmost_bind = true;
  
        fprintf (file, "{\n");
!       for (vars = cfun->unexpanded_var_list; vars; vars = TREE_CHAIN (vars))
  	{
  	  var = TREE_VALUE (vars);
  
--- 6151,6162 ----
  
    /* When GIMPLE is lowered, the variables are no longer available in
       BIND_EXPRs, so display them separately.  */
!   if (cfun && cfun->decl == fn && cfun->local_decls)
      {
        ignore_topmost_bind = true;
  
        fprintf (file, "{\n");
!       for (vars = cfun->local_decls; vars; vars = TREE_CHAIN (vars))
  	{
  	  var = TREE_VALUE (vars);
  
Index: ipa-struct-reorg.c
===================================================================
*** ipa-struct-reorg.c	(revision 134086)
--- ipa-struct-reorg.c	(working copy)
*************** build_data_structure (VEC (tree, heap) *
*** 3443,3449 ****
  		add_structure (type);
  
  	  /* Check function local variables.  */
! 	  for (var_list = fn->unexpanded_var_list; var_list; 
  	       var_list = TREE_CHAIN (var_list))
  	    {
  	      var = TREE_VALUE (var_list);
--- 3443,3449 ----
  		add_structure (type);
  
  	  /* Check function local variables.  */
! 	  for (var_list = fn->local_decls; var_list; 
  	       var_list = TREE_CHAIN (var_list))
  	    {
  	      var = TREE_VALUE (var_list);
Index: config/i386/i386.c
===================================================================
*** config/i386/i386.c	(revision 134087)
--- config/i386/i386.c	(working copy)
*************** setup_incoming_varargs_64 (CUMULATIVE_AR
*** 5060,5066 ****
       We also may end up assuming that only 64bit values are stored in SSE
       register let some floating point program work.  */
    if (ix86_preferred_stack_boundary >= BIGGEST_ALIGNMENT)
!     cfun->stack_alignment_needed = BIGGEST_ALIGNMENT;
  
    save_area = frame_pointer_rtx;
    set = get_varargs_alias_set ();
--- 5060,5066 ----
       We also may end up assuming that only 64bit values are stored in SSE
       register let some floating point program work.  */
    if (ix86_preferred_stack_boundary >= BIGGEST_ALIGNMENT)
!     crtl->stack_alignment_needed = BIGGEST_ALIGNMENT;
  
    save_area = frame_pointer_rtx;
    set = get_varargs_alias_set ();
*************** ix86_compute_frame_layout (struct ix86_f
*** 6098,6105 ****
    frame->nregs = ix86_nsaved_regs ();
    total_size = size;
  
!   stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT;
!   preferred_alignment = cfun->preferred_stack_boundary / BITS_PER_UNIT;
  
    /* During reload iteration the amount of registers saved can change.
       Recompute the value as needed.  Do not recompute when amount of registers
--- 6098,6105 ----
    frame->nregs = ix86_nsaved_regs ();
    total_size = size;
  
!   stack_alignment_needed = crtl->stack_alignment_needed / BITS_PER_UNIT;
!   preferred_alignment = crtl->preferred_stack_boundary / BITS_PER_UNIT;
  
    /* During reload iteration the amount of registers saved can change.
       Recompute the value as needed.  Do not recompute when amount of registers
Index: config/arc/arc.c
===================================================================
*** config/arc/arc.c	(revision 134087)
--- config/arc/arc.c	(working copy)
*************** arc_output_function_prologue (FILE *file
*** 1254,1260 ****
  static void
  arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
  {
!   rtx epilogue_delay = current_function_epilogue_delay_list;
    int noepilogue = FALSE;
    enum arc_function_type fn_type = arc_compute_function_type (current_function_decl);
  
--- 1254,1260 ----
  static void
  arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
  {
!   rtx epilogue_delay = crtl->epilogue_delay_list;
    int noepilogue = FALSE;
    enum arc_function_type fn_type = arc_compute_function_type (current_function_decl);
  
Index: cfgrtl.c
===================================================================
*** cfgrtl.c	(revision 134086)
--- cfgrtl.c	(working copy)
*************** print_rtl_with_bb (FILE *outf, const_rtx
*** 1651,1660 ****
        free (in_bb_p);
      }
  
!   if (current_function_epilogue_delay_list != 0)
      {
        fprintf (outf, "\n;; Insns in epilogue delay list:\n\n");
!       for (tmp_rtx = current_function_epilogue_delay_list; tmp_rtx != 0;
  	   tmp_rtx = XEXP (tmp_rtx, 1))
  	print_rtl_single (outf, XEXP (tmp_rtx, 0));
      }
--- 1651,1660 ----
        free (in_bb_p);
      }
  
!   if (crtl->epilogue_delay_list != 0)
      {
        fprintf (outf, "\n;; Insns in epilogue delay list:\n\n");
!       for (tmp_rtx = crtl->epilogue_delay_list; tmp_rtx != 0;
  	   tmp_rtx = XEXP (tmp_rtx, 1))
  	print_rtl_single (outf, XEXP (tmp_rtx, 0));
      }
Index: reload1.c
===================================================================
*** reload1.c	(revision 134086)
--- reload1.c	(working copy)
*************** reload (rtx first, int global)
*** 1012,1018 ****
        /* If we allocated another stack slot, redo elimination bookkeeping.  */
        if (starting_frame_size != get_frame_size ())
  	continue;
!       if (starting_frame_size && cfun->stack_alignment_needed)
  	{
  	  /* If we have a stack frame, we must align it now.  The
  	     stack size may be a part of the offset computation for
--- 1012,1018 ----
        /* If we allocated another stack slot, redo elimination bookkeeping.  */
        if (starting_frame_size != get_frame_size ())
  	continue;
!       if (starting_frame_size && crtl->stack_alignment_needed)
  	{
  	  /* If we have a stack frame, we must align it now.  The
  	     stack size may be a part of the offset computation for
*************** reload (rtx first, int global)
*** 1022,1028 ****
  	     stack frame when none is needed should
  	     STARTING_FRAME_OFFSET not be already aligned to
  	     STACK_BOUNDARY.  */
! 	  assign_stack_local (BLKmode, 0, cfun->stack_alignment_needed);
  	  if (starting_frame_size != get_frame_size ())
  	    continue;
  	}
--- 1022,1028 ----
  	     stack frame when none is needed should
  	     STARTING_FRAME_OFFSET not be already aligned to
  	     STACK_BOUNDARY.  */
! 	  assign_stack_local (BLKmode, 0, crtl->stack_alignment_needed);
  	  if (starting_frame_size != get_frame_size ())
  	    continue;
  	}


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