diff mbox

[5/5] Remove function.h dependency on hard-reg-set.

Message ID 55805B08.6050703@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod June 16, 2015, 5:21 p.m. UTC
function.h defines struct rtl_data which is used for generating rtl. In 
particular, it defines an instance 'crtl' which for generating rtl 
appears analagous to cfun for gimple and trees.

That is the only reason function.h requires hard-reg-set.h.  I tried a 
lot of variations.. like moving it into rtl.h, moving it into its own 
file,  and eventually settled on putting it in emit-rtl.h   In fact, it 
turns out emit-rtl.c is where the instance is actually declared.... 
function.h was simply providing a reference to it so someone didn't have 
to include emit-rtl I guess.  BUt then emit-rtl.h has most of the inline 
functions for accessing it.  There appears to be some historical reason 
for not wanting to include emit-rtl.h? Im not sure.

Placing it in rtl.h appeared to be someones original plan if I read the 
various comments correctly. I tried that in many variations, but the 
intricate dance between the generators and rtl.h and how to detect who 
really needs it made it ugly, and I couldn't find any decent way to do 
it.  Putting it in Its own file worked OK, but it required that file to 
be incliuded a lot of other places.  Thats still an option however.    
Given the changes to put it into emit-rtl.h are so simple in comparison, 
and all the routines that manipulate are already declared there, it 
seems like the most appropriate place.

there were also 2 function prototypes in function.h which were guarded 
by #ifdef RTX_CODE....  I remove that and let the prototypes be 
defined.  I'm not sure why they were guarded... they aren't called if 
there is no RTX_CODE defined anyway... lots of other parameter lists 
refer to 'rtx' and there's no compilation error if the prototypes is 
produced but not used.

By doing that, there is no longer any ordering requirement that 
function.h be included before rtl.h, and no dependency.  And of course, 
function.h no longer requires hard-reg-set.h etiher.

bootstraps on x86_64-unknown-linux-gnu with no new regressions, and also 
compiles stage 1 for all the targets in config-list.mk.

OK for trunk?
Andrew

Comments

Richard Biener June 17, 2015, 12:40 p.m. UTC | #1
On Tue, Jun 16, 2015 at 7:21 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
> function.h defines struct rtl_data which is used for generating rtl. In
> particular, it defines an instance 'crtl' which for generating rtl appears
> analagous to cfun for gimple and trees.
>
> That is the only reason function.h requires hard-reg-set.h.  I tried a lot
> of variations.. like moving it into rtl.h, moving it into its own file,  and
> eventually settled on putting it in emit-rtl.h   In fact, it turns out
> emit-rtl.c is where the instance is actually declared.... function.h was
> simply providing a reference to it so someone didn't have to include
> emit-rtl I guess.  BUt then emit-rtl.h has most of the inline functions for
> accessing it.  There appears to be some historical reason for not wanting to
> include emit-rtl.h? Im not sure.
>
> Placing it in rtl.h appeared to be someones original plan if I read the
> various comments correctly. I tried that in many variations, but the
> intricate dance between the generators and rtl.h and how to detect who
> really needs it made it ugly, and I couldn't find any decent way to do it.
> Putting it in Its own file worked OK, but it required that file to be
> incliuded a lot of other places.  Thats still an option however.    Given
> the changes to put it into emit-rtl.h are so simple in comparison, and all
> the routines that manipulate are already declared there, it seems like the
> most appropriate place.
>
> there were also 2 function prototypes in function.h which were guarded by
> #ifdef RTX_CODE....  I remove that and let the prototypes be defined.  I'm
> not sure why they were guarded... they aren't called if there is no RTX_CODE
> defined anyway... lots of other parameter lists refer to 'rtx' and there's
> no compilation error if the prototypes is produced but not used.
>
> By doing that, there is no longer any ordering requirement that function.h
> be included before rtl.h, and no dependency.  And of course, function.h no
> longer requires hard-reg-set.h etiher.
>
> bootstraps on x86_64-unknown-linux-gnu with no new regressions, and also
> compiles stage 1 for all the targets in config-list.mk.

Ok.

Thanks,
Richard.

> OK for trunk?
> Andrew
diff mbox

Patch



	* function.h (struct rtl_data): Remove struct and accessor macros.
	* emit-rtl.h (struct rtl_data): Relocate to here.
	* Makefile.in (GTFILES): Add emit-rtl.h.
	* df-core.c: Include emit-rtl.h.
	* genattrtab.c: Likewise.
	* genconditions.c: Likewise.
	* genpreds.c: Likewise.
	* genrecog.c: Likewise.
	* regcprop.c: Likewise.
	* resource.c: Likewise.
	* sched-rgn.c: Likewise.
	* config/aarch64/cortex-a57-fma-steering.c: Likewise.
	* config/i386/winnt.c: Likewise.


Index: function.h
===================================================================
*** function.h	(revision 224493)
--- function.h	(working copy)
*************** struct GTY(()) rtl_eh {
*** 153,160 ****
  #define stack_pointer_delta (crtl->expr.x_stack_pointer_delta)
  
  struct gimple_df;
- struct temp_slot;
- typedef struct temp_slot *temp_slot_p;
  struct call_site_record_d;
  struct dw_fde_node;
  
--- 153,158 ----
*************** struct GTY(()) frame_space
*** 223,483 ****
    HOST_WIDE_INT length;
  };
  
- /* Datastructures maintained for currently processed function in RTL form.  */
- struct GTY(()) rtl_data {
-   struct expr_status expr;
-   struct emit_status emit;
-   struct varasm_status varasm;
-   struct incoming_args args;
-   struct function_subsections subsections;
-   struct rtl_eh eh;
- 
-   /* For function.c  */
- 
-   /* # of bytes of outgoing arguments.  If ACCUMULATE_OUTGOING_ARGS is
-      defined, the needed space is pushed by the prologue.  */
-   int outgoing_args_size;
- 
-   /* If nonzero, an RTL expression for the location at which the current
-      function returns its result.  If the current function returns its
-      result in a register, current_function_return_rtx will always be
-      the hard register containing the result.  */
-   rtx return_rtx;
-   /* If nonxero, an RTL expression for the lcoation at which the current
-      function returns bounds for its result.  */
-   rtx return_bnd;
- 
-   /* Vector of initial-value pairs.  Each pair consists of a pseudo
-      register of approprite mode that stores the initial value a hard
-      register REGNO, and that hard register itself.  */
-   /* ??? This could be a VEC but there is currently no way to define an
- 	 opaque VEC type.  */
-   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 INSN_LIST) of labels heading the current handlers for
-      nonlocal gotos.  */
-   rtx_insn_list *x_nonlocal_goto_handler_labels;
- 
-   /* Label that will go on function epilogue.
-      Jumping to this label serves as a "return" instruction
-      on machines which require execution of the epilogue on all returns.  */
-   rtx_code_label *x_return_label;
- 
-   /* Label that will go on the end of function epilogue.
-      Jumping to this label serves as a "naked return" instruction
-      on machines which require execution of the epilogue on all returns.  */
-   rtx_code_label *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_expr_list *x_stack_slot_list;
- 
-   /* List of empty areas in the stack frame.  */
-   struct frame_space *frame_space_list;
- 
-   /* Place after which to insert the tail_recursion_label if we need one.  */
-   rtx_note *x_stack_check_probe_note;
- 
-   /* Location at which to save the argument pointer if it will need to be
-      referenced.  There are two cases where this is done: if nonlocal gotos
-      exist, or if vars stored at an offset from the argument pointer will be
-      needed by inner routines.  */
-   rtx x_arg_pointer_save_area;
- 
-   /* Dynamic Realign Argument Pointer used for realigning stack.  */
-   rtx drap_reg;
- 
-   /* Offset to end of allocated area of stack frame.
-      If stack grows down, this is the address of the last stack slot allocated.
-      If stack grows up, this is the address for the next slot.  */
-   HOST_WIDE_INT x_frame_offset;
- 
-   /* Insn after which register parms and SAVE_EXPRs are born, if nonopt.  */
-   rtx_insn *x_parm_birth_insn;
- 
-   /* List of all used temporaries allocated, by level.  */
-   vec<temp_slot_p, va_gc> *x_used_temp_slots;
- 
-   /* List of available temp slots.  */
-   struct temp_slot *x_avail_temp_slots;
- 
-   /* Current nesting level for temporaries.  */
-   int x_temp_slot_level;
- 
-   /* The largest alignment needed on the stack, including requirement
-      for outgoing stack alignment.  */
-   unsigned int stack_alignment_needed;
- 
-   /* Preferred alignment of the end of stack frame, which is preferred
-      to call other functions.  */
-   unsigned int preferred_stack_boundary;
- 
-   /* The minimum alignment of parameter stack.  */
-   unsigned int parm_stack_boundary;
- 
-   /* The largest alignment of slot allocated on the stack.  */
-   unsigned int max_used_stack_slot_alignment;
- 
-   /* The stack alignment estimated before reload, with consideration of
-      following factors:
-      1. Alignment of local stack variables (max_used_stack_slot_alignment)
-      2. Alignment requirement to call other functions
-         (preferred_stack_boundary)
-      3. Alignment of non-local stack variables but might be spilled in
-         local stack.  */
-   unsigned int stack_alignment_estimated;
- 
-   /* For reorg.  */
- 
-   /* Nonzero if function being compiled called builtin_return_addr or
-      builtin_frame_address with nonzero count.  */
-   bool accesses_prior_frames;
- 
-   /* Nonzero if the function calls __builtin_eh_return.  */
-   bool calls_eh_return;
- 
-   /* Nonzero if function saves all registers, e.g. if it has a nonlocal
-      label that can reach the exit block via non-exceptional paths. */
-   bool saves_all_registers;
- 
-   /* Nonzero if function being compiled has nonlocal gotos to parent
-      function.  */
-   bool has_nonlocal_goto;
- 
-   /* Nonzero if function being compiled has an asm statement.  */
-   bool has_asm_statement;
- 
-   /* This bit is used by the exception handling logic.  It is set if all
-      calls (if any) are sibling calls.  Such functions do not have to
-      have EH tables generated, as they cannot throw.  A call to such a
-      function, however, should be treated as throwing if any of its callees
-      can throw.  */
-   bool all_throwers_are_sibcalls;
- 
-   /* Nonzero if stack limit checking should be enabled in the current
-      function.  */
-   bool limit_stack;
- 
-   /* Nonzero if profiling code should be generated.  */
-   bool profile;
- 
-   /* Nonzero if the current function uses the constant pool.  */
-   bool uses_const_pool;
- 
-   /* Nonzero if the current function uses pic_offset_table_rtx.  */
-   bool uses_pic_offset_table;
- 
-   /* Nonzero if the current function needs an lsda for exception handling.  */
-   bool uses_eh_lsda;
- 
-   /* Set when the tail call has been produced.  */
-   bool tail_call_emit;
- 
-   /* Nonzero if code to initialize arg_pointer_save_area has been emitted.  */
-   bool arg_pointer_save_area_init;
- 
-   /* Nonzero if current function must be given a frame pointer.
-      Set in reload1.c or lra-eliminations.c if anything is allocated
-      on the stack there.  */
-   bool frame_pointer_needed;
- 
-   /* When set, expand should optimize for speed.  */
-   bool maybe_hot_insn_p;
- 
-   /* Nonzero if function stack realignment is needed.  This flag may be
-      set twice: before and after reload.  It is set before reload wrt
-      stack alignment estimation before reload.  It will be changed after
-      reload if by then criteria of stack realignment is different.
-      The value set after reload is the accurate one and is finalized.  */
-   bool stack_realign_needed;
- 
-   /* Nonzero if function stack realignment is tried.  This flag is set
-      only once before reload.  It affects register elimination.  This
-      is used to generate DWARF debug info for stack variables.  */
-   bool stack_realign_tried;
- 
-   /* Nonzero if function being compiled needs dynamic realigned
-      argument pointer (drap) if stack needs realigning.  */
-   bool need_drap;
- 
-   /* Nonzero if function stack realignment estimation is done, namely
-      stack_realign_needed flag has been set before reload wrt estimated
-      stack alignment info.  */
-   bool stack_realign_processed;
- 
-   /* Nonzero if function stack realignment has been finalized, namely
-      stack_realign_needed flag has been set and finalized after reload.  */
-   bool stack_realign_finalized;
- 
-   /* True if dbr_schedule has already been called for this function.  */
-   bool dbr_scheduled_p;
- 
-   /* True if current function can not throw.  Unlike
-      TREE_NOTHROW (current_function_decl) it is set even for overwritable
-      function where currently compiled version of it is nothrow.  */
-   bool nothrow;
- 
-   /* True if we performed shrink-wrapping for the current function.  */
-   bool shrink_wrapped;
- 
-   /* Nonzero if function being compiled doesn't modify the stack pointer
-      (ignoring the prologue and epilogue).  This is only valid after
-      pass_stack_ptr_mod has run.  */
-   bool sp_is_unchanging;
- 
-   /* Nonzero if function being compiled doesn't contain any calls
-      (ignoring the prologue and epilogue).  This is set prior to
-      local register allocation and is valid for the remaining
-      compiler passes.  */
-   bool is_leaf;
- 
-   /* Nonzero if the function being compiled is a leaf function which only
-      uses leaf registers.  This is valid after reload (specifically after
-      sched2) and is useful only if the port defines LEAF_REGISTERS.  */
-   bool uses_only_leaf_regs;
- 
-   /* Nonzero if the function being compiled has undergone hot/cold partitioning
-      (under flag_reorder_blocks_and_partition) and has at least one cold
-      block.  */
-   bool has_bb_partition;
- 
-   /* Nonzero if the function being compiled has completed the bb reordering
-      pass.  */
-   bool bb_reorder_complete;
- 
-   /* Like regs_ever_live, but 1 if a reg is set or clobbered from an
-      asm.  Unlike regs_ever_live, elements of this array corresponding
-      to eliminable regs (like the frame pointer) are set if an asm
-      sets them.  */
-   HARD_REG_SET asm_clobbers;
- };
- 
- #define return_label (crtl->x_return_label)
- #define naked_return_label (crtl->x_naked_return_label)
- #define stack_slot_list (crtl->x_stack_slot_list)
- #define parm_birth_insn (crtl->x_parm_birth_insn)
- #define frame_offset (crtl->x_frame_offset)
- #define stack_check_probe_note (crtl->x_stack_check_probe_note)
- #define arg_pointer_save_area (crtl->x_arg_pointer_save_area)
- #define used_temp_slots (crtl->x_used_temp_slots)
- #define avail_temp_slots (crtl->x_avail_temp_slots)
- #define temp_slot_level (crtl->x_temp_slot_level)
- #define nonlocal_goto_handler_labels (crtl->x_nonlocal_goto_handler_labels)
- #define frame_pointer_needed (crtl->frame_pointer_needed)
- #define stack_realign_fp (crtl->stack_realign_needed && !crtl->need_drap)
- #define stack_realign_drap (crtl->stack_realign_needed && crtl->need_drap)
- 
- extern GTY(()) struct rtl_data x_rtl;
- 
- /* Accessor to RTL datastructures.  We keep them statically allocated now since
-    we never keep multiple functions.  For threaded compiler we might however
-    want to do differently.  */
- #define crtl (&x_rtl)
- 
  struct GTY(()) stack_usage
  {
    /* # of bytes of static stack space allocated by the function.  */
--- 221,226 ----
*************** extern void expand_function_start (tree)
*** 905,916 ****
  extern void expand_dummy_function_end (void);
  
  extern void thread_prologue_and_epilogue_insns (void);
- 
- #ifdef RTX_CODE
  extern void diddle_return_value (void (*)(rtx, void*), void*);
  extern void clobber_return_register (void);
- #endif
- 
  extern void do_warn_unused_parameter (tree);
  extern void expand_function_end (void);
  extern rtx get_arg_pointer_save_area (void);
--- 648,655 ----
Index: emit-rtl.h
===================================================================
*** emit-rtl.h	(revision 224493)
--- emit-rtl.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 20,25 ****
--- 20,283 ----
  #ifndef GCC_EMIT_RTL_H
  #define GCC_EMIT_RTL_H
  
+ struct temp_slot;
+ typedef struct temp_slot *temp_slot_p;
+ 
+ /* Datastructures maintained for currently processed function in RTL form.  */
+ struct GTY(()) rtl_data {
+   struct expr_status expr;
+   struct emit_status emit;
+   struct varasm_status varasm;
+   struct incoming_args args;
+   struct function_subsections subsections;
+   struct rtl_eh eh;
+ 
+   /* For function.c  */
+ 
+   /* # of bytes of outgoing arguments.  If ACCUMULATE_OUTGOING_ARGS is
+      defined, the needed space is pushed by the prologue.  */
+   int outgoing_args_size;
+ 
+   /* If nonzero, an RTL expression for the location at which the current
+      function returns its result.  If the current function returns its
+      result in a register, current_function_return_rtx will always be
+      the hard register containing the result.  */
+   rtx return_rtx;
+   /* If nonxero, an RTL expression for the lcoation at which the current
+      function returns bounds for its result.  */
+   rtx return_bnd;
+ 
+   /* Vector of initial-value pairs.  Each pair consists of a pseudo
+      register of approprite mode that stores the initial value a hard
+      register REGNO, and that hard register itself.  */
+   /* ??? This could be a VEC but there is currently no way to define an
+ 	 opaque VEC type.  */
+   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 INSN_LIST) of labels heading the current handlers for
+      nonlocal gotos.  */
+   rtx_insn_list *x_nonlocal_goto_handler_labels;
+ 
+   /* Label that will go on function epilogue.
+      Jumping to this label serves as a "return" instruction
+      on machines which require execution of the epilogue on all returns.  */
+   rtx_code_label *x_return_label;
+ 
+   /* Label that will go on the end of function epilogue.
+      Jumping to this label serves as a "naked return" instruction
+      on machines which require execution of the epilogue on all returns.  */
+   rtx_code_label *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_expr_list *x_stack_slot_list;
+ 
+   /* List of empty areas in the stack frame.  */
+   struct frame_space *frame_space_list;
+ 
+   /* Place after which to insert the tail_recursion_label if we need one.  */
+   rtx_note *x_stack_check_probe_note;
+ 
+   /* Location at which to save the argument pointer if it will need to be
+      referenced.  There are two cases where this is done: if nonlocal gotos
+      exist, or if vars stored at an offset from the argument pointer will be
+      needed by inner routines.  */
+   rtx x_arg_pointer_save_area;
+ 
+   /* Dynamic Realign Argument Pointer used for realigning stack.  */
+   rtx drap_reg;
+ 
+   /* Offset to end of allocated area of stack frame.
+      If stack grows down, this is the address of the last stack slot allocated.
+      If stack grows up, this is the address for the next slot.  */
+   HOST_WIDE_INT x_frame_offset;
+ 
+   /* Insn after which register parms and SAVE_EXPRs are born, if nonopt.  */
+   rtx_insn *x_parm_birth_insn;
+ 
+   /* List of all used temporaries allocated, by level.  */
+   vec<temp_slot_p, va_gc> *x_used_temp_slots;
+ 
+   /* List of available temp slots.  */
+   struct temp_slot *x_avail_temp_slots;
+ 
+   /* Current nesting level for temporaries.  */
+   int x_temp_slot_level;
+ 
+   /* The largest alignment needed on the stack, including requirement
+      for outgoing stack alignment.  */
+   unsigned int stack_alignment_needed;
+ 
+   /* Preferred alignment of the end of stack frame, which is preferred
+      to call other functions.  */
+   unsigned int preferred_stack_boundary;
+ 
+   /* The minimum alignment of parameter stack.  */
+   unsigned int parm_stack_boundary;
+ 
+   /* The largest alignment of slot allocated on the stack.  */
+   unsigned int max_used_stack_slot_alignment;
+ 
+   /* The stack alignment estimated before reload, with consideration of
+      following factors:
+      1. Alignment of local stack variables (max_used_stack_slot_alignment)
+      2. Alignment requirement to call other functions
+         (preferred_stack_boundary)
+      3. Alignment of non-local stack variables but might be spilled in
+         local stack.  */
+   unsigned int stack_alignment_estimated;
+ 
+   /* For reorg.  */
+ 
+   /* Nonzero if function being compiled called builtin_return_addr or
+      builtin_frame_address with nonzero count.  */
+   bool accesses_prior_frames;
+ 
+   /* Nonzero if the function calls __builtin_eh_return.  */
+   bool calls_eh_return;
+ 
+   /* Nonzero if function saves all registers, e.g. if it has a nonlocal
+      label that can reach the exit block via non-exceptional paths. */
+   bool saves_all_registers;
+ 
+   /* Nonzero if function being compiled has nonlocal gotos to parent
+      function.  */
+   bool has_nonlocal_goto;
+ 
+   /* Nonzero if function being compiled has an asm statement.  */
+   bool has_asm_statement;
+ 
+   /* This bit is used by the exception handling logic.  It is set if all
+      calls (if any) are sibling calls.  Such functions do not have to
+      have EH tables generated, as they cannot throw.  A call to such a
+      function, however, should be treated as throwing if any of its callees
+      can throw.  */
+   bool all_throwers_are_sibcalls;
+ 
+   /* Nonzero if stack limit checking should be enabled in the current
+      function.  */
+   bool limit_stack;
+ 
+   /* Nonzero if profiling code should be generated.  */
+   bool profile;
+ 
+   /* Nonzero if the current function uses the constant pool.  */
+   bool uses_const_pool;
+ 
+   /* Nonzero if the current function uses pic_offset_table_rtx.  */
+   bool uses_pic_offset_table;
+ 
+   /* Nonzero if the current function needs an lsda for exception handling.  */
+   bool uses_eh_lsda;
+ 
+   /* Set when the tail call has been produced.  */
+   bool tail_call_emit;
+ 
+   /* Nonzero if code to initialize arg_pointer_save_area has been emitted.  */
+   bool arg_pointer_save_area_init;
+ 
+   /* Nonzero if current function must be given a frame pointer.
+      Set in reload1.c or lra-eliminations.c if anything is allocated
+      on the stack there.  */
+   bool frame_pointer_needed;
+ 
+   /* When set, expand should optimize for speed.  */
+   bool maybe_hot_insn_p;
+ 
+   /* Nonzero if function stack realignment is needed.  This flag may be
+      set twice: before and after reload.  It is set before reload wrt
+      stack alignment estimation before reload.  It will be changed after
+      reload if by then criteria of stack realignment is different.
+      The value set after reload is the accurate one and is finalized.  */
+   bool stack_realign_needed;
+ 
+   /* Nonzero if function stack realignment is tried.  This flag is set
+      only once before reload.  It affects register elimination.  This
+      is used to generate DWARF debug info for stack variables.  */
+   bool stack_realign_tried;
+ 
+   /* Nonzero if function being compiled needs dynamic realigned
+      argument pointer (drap) if stack needs realigning.  */
+   bool need_drap;
+ 
+   /* Nonzero if function stack realignment estimation is done, namely
+      stack_realign_needed flag has been set before reload wrt estimated
+      stack alignment info.  */
+   bool stack_realign_processed;
+ 
+   /* Nonzero if function stack realignment has been finalized, namely
+      stack_realign_needed flag has been set and finalized after reload.  */
+   bool stack_realign_finalized;
+ 
+   /* True if dbr_schedule has already been called for this function.  */
+   bool dbr_scheduled_p;
+ 
+   /* True if current function can not throw.  Unlike
+      TREE_NOTHROW (current_function_decl) it is set even for overwritable
+      function where currently compiled version of it is nothrow.  */
+   bool nothrow;
+ 
+   /* True if we performed shrink-wrapping for the current function.  */
+   bool shrink_wrapped;
+ 
+   /* Nonzero if function being compiled doesn't modify the stack pointer
+      (ignoring the prologue and epilogue).  This is only valid after
+      pass_stack_ptr_mod has run.  */
+   bool sp_is_unchanging;
+ 
+   /* Nonzero if function being compiled doesn't contain any calls
+      (ignoring the prologue and epilogue).  This is set prior to
+      local register allocation and is valid for the remaining
+      compiler passes.  */
+   bool is_leaf;
+ 
+   /* Nonzero if the function being compiled is a leaf function which only
+      uses leaf registers.  This is valid after reload (specifically after
+      sched2) and is useful only if the port defines LEAF_REGISTERS.  */
+   bool uses_only_leaf_regs;
+ 
+   /* Nonzero if the function being compiled has undergone hot/cold partitioning
+      (under flag_reorder_blocks_and_partition) and has at least one cold
+      block.  */
+   bool has_bb_partition;
+ 
+   /* Nonzero if the function being compiled has completed the bb reordering
+      pass.  */
+   bool bb_reorder_complete;
+ 
+   /* Like regs_ever_live, but 1 if a reg is set or clobbered from an
+      asm.  Unlike regs_ever_live, elements of this array corresponding
+      to eliminable regs (like the frame pointer) are set if an asm
+      sets them.  */
+   HARD_REG_SET asm_clobbers;
+ };
+ 
+ #define return_label (crtl->x_return_label)
+ #define naked_return_label (crtl->x_naked_return_label)
+ #define stack_slot_list (crtl->x_stack_slot_list)
+ #define parm_birth_insn (crtl->x_parm_birth_insn)
+ #define frame_offset (crtl->x_frame_offset)
+ #define stack_check_probe_note (crtl->x_stack_check_probe_note)
+ #define arg_pointer_save_area (crtl->x_arg_pointer_save_area)
+ #define used_temp_slots (crtl->x_used_temp_slots)
+ #define avail_temp_slots (crtl->x_avail_temp_slots)
+ #define temp_slot_level (crtl->x_temp_slot_level)
+ #define nonlocal_goto_handler_labels (crtl->x_nonlocal_goto_handler_labels)
+ #define frame_pointer_needed (crtl->frame_pointer_needed)
+ #define stack_realign_fp (crtl->stack_realign_needed && !crtl->need_drap)
+ #define stack_realign_drap (crtl->stack_realign_needed && crtl->need_drap)
+ 
+ extern GTY(()) struct rtl_data x_rtl;
+ 
+ /* Accessor to RTL datastructures.  We keep them statically allocated now since
+    we never keep multiple functions.  For threaded compiler we might however
+    want to do differently.  */
+ #define crtl (&x_rtl)
+ 
  /* Return whether two MEM_ATTRs are equal.  */
  bool mem_attrs_eq_p (const struct mem_attrs *, const struct mem_attrs *);
  
Index: Makefile.in
===================================================================
*** Makefile.in	(revision 224493)
--- Makefile.in	(working copy)
*************** GTFILES = $(CPP_ID_DATA_H) $(srcdir)/inp
*** 2321,2327 ****
    $(srcdir)/dwarf2cfi.c \
    $(srcdir)/dwarf2out.c \
    $(srcdir)/tree-vect-generic.c \
!   $(srcdir)/dojump.c \
    $(srcdir)/emit-rtl.c $(srcdir)/except.h $(srcdir)/explow.c $(srcdir)/expr.c \
    $(srcdir)/expr.h \
    $(srcdir)/function.c $(srcdir)/except.c \
--- 2321,2327 ----
    $(srcdir)/dwarf2cfi.c \
    $(srcdir)/dwarf2out.c \
    $(srcdir)/tree-vect-generic.c \
!   $(srcdir)/dojump.c $(srcdir)/emit-rtl.h \
    $(srcdir)/emit-rtl.c $(srcdir)/except.h $(srcdir)/explow.c $(srcdir)/expr.c \
    $(srcdir)/expr.h \
    $(srcdir)/function.c $(srcdir)/except.c \
Index: df-core.c
===================================================================
*** df-core.c	(revision 224493)
--- df-core.c	(working copy)
*************** are write-only operations.
*** 399,404 ****
--- 399,405 ----
  #include "tree-pass.h"
  #include "params.h"
  #include "cfgloop.h"
+ #include "emit-rtl.h"
  
  static void *df_get_bb_info (struct dataflow *, unsigned int);
  static void df_set_bb_info (struct dataflow *, unsigned int, void *);
Index: genattrtab.c
===================================================================
*** genattrtab.c	(revision 224493)
--- genattrtab.c	(working copy)
*************** write_header (FILE *outf)
*** 5127,5132 ****
--- 5127,5133 ----
    fprintf (outf, "#include \"toplev.h\"\n");
    fprintf (outf, "#include \"flags.h\"\n");
    fprintf (outf, "#include \"function.h\"\n");
+   fprintf (outf, "#include \"emit-rtl.h\"\n");
    fprintf (outf, "#include \"predict.h\"\n");
    fprintf (outf, "\n");
    fprintf (outf, "#define operands recog_data.operand\n\n");
Index: genconditions.c
===================================================================
*** genconditions.c	(revision 224493)
--- genconditions.c	(working copy)
*************** write_header (void)
*** 73,78 ****
--- 73,79 ----
  #include \"tm_p.h\"\n\
  #include \"hard-reg-set.h\"\n\
  #include \"function.h\"\n\
+ #include \"emit-rtl.h\"\n\
  \n\
  /* Fake - insn-config.h doesn't exist yet.  */\n\
  #define MAX_RECOG_OPERANDS 10\n\
Index: genpreds.c
===================================================================
*** genpreds.c	(revision 224493)
--- genpreds.c	(working copy)
*************** write_insn_preds_c (void)
*** 1558,1563 ****
--- 1558,1564 ----
  #include \"diagnostic-core.h\"\n\
  #include \"reload.h\"\n\
  #include \"regs.h\"\n\
+ #include \"emit-rtl.h\"\n\
  #include \"tm-constrs.h\"\n");
  
    FOR_ALL_PREDICATES (p)
Index: genrecog.c
===================================================================
*** genrecog.c	(revision 224493)
--- genrecog.c	(working copy)
*************** write_header (void)
*** 4191,4196 ****
--- 4191,4197 ----
  #include \"hard-reg-set.h\"\n\
  #include \"input.h\"\n\
  #include \"function.h\"\n\
+ #include \"emit-rtl.h\"\n\
  #include \"insn-config.h\"\n\
  #include \"recog.h\"\n\
  #include \"output.h\"\n\
Index: regcprop.c
===================================================================
*** regcprop.c	(revision 224493)
--- regcprop.c	(working copy)
***************
*** 41,46 ****
--- 41,47 ----
  #include "tree-pass.h"
  #include "df.h"
  #include "rtl-iter.h"
+ #include "emit-rtl.h"
  
  /* The following code does forward propagation of hard register copies.
     The object is to eliminate as many dependencies as possible, so that
Index: resource.c
===================================================================
*** resource.c	(revision 224493)
--- resource.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 39,44 ****
--- 39,45 ----
  #include "insn-attr.h"
  #include "params.h"
  #include "df.h"
+ #include "emit-rtl.h"
  
  /* This structure is used to record liveness information at the targets or
     fallthrough insns of branches.  We will most likely need the information
Index: sched-rgn.c
===================================================================
*** sched-rgn.c	(revision 224493)
--- sched-rgn.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 71,76 ****
--- 71,77 ----
  #include "target.h"
  #include "tree-pass.h"
  #include "dbgcnt.h"
+ #include "emit-rtl.h"
  
  #ifdef INSN_SCHEDULING
  
Index: config/aarch64/cortex-a57-fma-steering.c
===================================================================
*** config/aarch64/cortex-a57-fma-steering.c	(revision 224493)
--- config/aarch64/cortex-a57-fma-steering.c	(working copy)
***************
*** 38,43 ****
--- 38,44 ----
  #include "df.h"
  #include "target.h"
  #include "rtl.h"
+ #include "emit-rtl.h"
  #include "context.h"
  #include "tree-pass.h"
  #include "regrename.h"
Index: config/i386/winnt.c
===================================================================
*** config/i386/winnt.c	(revision 224493)
--- config/i386/winnt.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 42,47 ****
--- 42,48 ----
  #include "predict.h"
  #include "input.h"
  #include "function.h"
+ #include "emit-rtl.h"
  #include "dominance.h"
  #include "cfg.h"
  #include "cfgrtl.h"