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]

ia32: prologue_epilogue_contains


Part 1 of N of merging generic new_ia32_branch bits to mainline.

This is intended to have init_alias_analysis ignore all prologue
instructions.  If it doesn't, it doesn't consider the frame pointer
to be a constant base.


r~


	* function.c (init_function_start): Clear prologue & epilogue.
	(prologue_epilogue_contains): New function.
	* alias.c (init_alias_analysis): Use it.
	* rtl.h (prologue_epilogue_contains): Declare it.

Index: alias.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/alias.c,v
retrieving revision 1.53
diff -c -p -d -r1.53 alias.c
*** alias.c	1999/05/30 23:51:39	1.53
--- alias.c	1999/08/02 23:47:13
*************** init_alias_analysis ()
*** 1468,1473 ****
--- 1468,1475 ----
        /* Walk the insns adding values to the new_reg_base_value array.  */
        for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
  	{
+ 	  if (prologue_epilogue_contains (insn))
+ 	    continue;
  	  if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
  	    {
  	      rtx note, set;
Index: function.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/function.c,v
retrieving revision 1.93
diff -c -p -d -r1.93 function.c
*** function.c	1999/08/01 12:07:35	1.93
--- function.c	1999/08/02 23:47:14
*************** struct function *current_function = 0;
*** 376,381 ****
--- 376,385 ----
  
  /* Global list of all compiled functions.  */
  struct function *all_functions = 0;
+ 
+ /* These arrays record the INSN_UIDs of the prologue and epilogue insns.  */
+ static int *prologue;
+ static int *epilogue;
  
  /* In order to evaluate some expressions, such as function calls returning
     structures in memory, we need to temporarily allocate stack locations.
*************** init_function_start (subr, filename, lin
*** 6050,6055 ****
--- 6054,6062 ----
  
    current_function_returns_pointer
      = POINTER_TYPE_P (TREE_TYPE (DECL_RESULT (subr)));
+ 
+   /* No prologue/epilogue insns yet.  */
+   prologue = epilogue = 0;
  }
  
  /* Indicate that the current function uses extra args
*************** expand_function_end (filename, line, end
*** 6656,6666 ****
    expand_fixups (get_insns ());
  }
  
- /* These arrays record the INSN_UIDs of the prologue and epilogue insns.  */
- 
- static int *prologue;
- static int *epilogue;
- 
  /* Create an array that records the INSN_UIDs of INSNS (either a sequence
     or a single insn).  */
  
--- 6663,6668 ----
*************** contains (insn, vec)
*** 6715,6720 ****
--- 6717,6733 ----
      }
    return 0;
  }
+ 
+ int
+ prologue_epilogue_contains (insn)
+      rtx insn;
+ {
+   if (prologue && contains (insn, prologue))
+     return 1;
+   if (epilogue && contains (insn, epilogue))
+     return 1;
+   return 0;
+ }
  #endif /* HAVE_prologue || HAVE_epilogue */
  
  /* Generate the prologue and epilogue RTL if the machine supports it.  Thread
*************** thread_prologue_and_epilogue_insns (f)
*** 6727,6733 ****
  {
    int insertted = 0;
  
-   prologue = 0;
  #ifdef HAVE_prologue
    if (HAVE_prologue)
      {
--- 6740,6745 ----
*************** thread_prologue_and_epilogue_insns (f)
*** 6762,6768 ****
      }
  #endif
  
-   epilogue = 0;
  #ifdef HAVE_epilogue
    if (HAVE_epilogue)
      {
--- 6774,6779 ----
Index: rtl.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/rtl.h,v
retrieving revision 1.107
diff -c -p -d -r1.107 rtl.h
*** rtl.h	1999/08/01 12:07:35	1.107
--- rtl.h	1999/08/02 23:47:14
*************** extern void record_excess_regs		PROTO ((
*** 1451,1456 ****
--- 1451,1457 ----
  /* In function.c */
  extern void reposition_prologue_and_epilogue_notes	PROTO ((rtx));
  extern void thread_prologue_and_epilogue_insns		PROTO ((rtx));
+ extern int prologue_epilogue_contains			PROTO ((rtx));
  extern void use_variable				PROTO ((rtx));
  extern HOST_WIDE_INT get_frame_size			PROTO ((void));
  extern void preserve_rtl_expr_result			PROTO ((rtx));


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