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]

ix86 -fomit-frame-pointer bootstrap fix



Hi
As jeff asked for, I've investigated this problem.
The -O2 -fomit-frame-pointer/ix86 failures are caused by MEM sharing 
in combine_stack_adjustemnts.  Sorry, I have no trivial testcase for this
bug.

Sat Mar 25 18:24:30 CET 2000  Jan Hubicka  <jh@suse.cz>

	* regmove.c (struct csa_memlist): Make mem field rtx *.
	(record_one_stack_ref): Accept rtx * instead of rtx as parameter.
	(try_apply_stack_adjustment): Replace whole MEM rtx.
	(combine_stack_adjustments_for_block): Update calls
	to record_one_stack_ref.

*** regmove.c.old	Sat Mar 25 18:11:42 2000
--- regmove.c	Sat Mar 25 18:23:56 2000
*************** stable_and_no_regs_but_for_p (x, src, ds
*** 2088,2094 ****
  struct csa_memlist
  {
    HOST_WIDE_INT sp_offset;
!   rtx insn, mem;
    struct csa_memlist *next;
  };
  
--- 2088,2094 ----
  struct csa_memlist
  {
    HOST_WIDE_INT sp_offset;
!   rtx insn, *mem;
    struct csa_memlist *next;
  };
  
*************** static int stack_memref_p		PARAMS ((rtx)
*** 2096,2102 ****
  static rtx single_set_for_csa		PARAMS ((rtx));
  static void free_csa_memlist		PARAMS ((struct csa_memlist *));
  static struct csa_memlist *record_one_stack_memref
!   PARAMS ((rtx, rtx, struct csa_memlist *));
  static int try_apply_stack_adjustment
    PARAMS ((rtx, struct csa_memlist *, HOST_WIDE_INT, HOST_WIDE_INT));
  static void combine_stack_adjustments_for_block PARAMS ((basic_block));
--- 2096,2102 ----
  static rtx single_set_for_csa		PARAMS ((rtx));
  static void free_csa_memlist		PARAMS ((struct csa_memlist *));
  static struct csa_memlist *record_one_stack_memref
!   PARAMS ((rtx, rtx *, struct csa_memlist *));
  static int try_apply_stack_adjustment
    PARAMS ((rtx, struct csa_memlist *, HOST_WIDE_INT, HOST_WIDE_INT));
  static void combine_stack_adjustments_for_block PARAMS ((basic_block));
*************** free_csa_memlist (memlist)
*** 2188,2204 ****
  
  static struct csa_memlist *
  record_one_stack_memref (insn, mem, next_memlist)
!      rtx insn, mem;
       struct csa_memlist *next_memlist;
  {
    struct csa_memlist *ml;
  
    ml = (struct csa_memlist *) xmalloc (sizeof (*ml));
  
!   if (XEXP (mem, 0) == stack_pointer_rtx)
      ml->sp_offset = 0;
    else
!     ml->sp_offset = INTVAL (XEXP (XEXP (mem, 0), 1));
  
    ml->insn = insn;
    ml->mem = mem;
--- 2188,2204 ----
  
  static struct csa_memlist *
  record_one_stack_memref (insn, mem, next_memlist)
!      rtx insn, *mem;
       struct csa_memlist *next_memlist;
  {
    struct csa_memlist *ml;
  
    ml = (struct csa_memlist *) xmalloc (sizeof (*ml));
  
!   if (XEXP (*mem, 0) == stack_pointer_rtx)
      ml->sp_offset = 0;
    else
!     ml->sp_offset = INTVAL (XEXP (XEXP (*mem, 0), 1));
  
    ml->insn = insn;
    ml->mem = mem;
*************** try_apply_stack_adjustment (insn, memlis
*** 2241,2248 ****
  	  return 0;
  	}
  
!       validate_change (ml->insn, &XEXP (ml->mem, 0),
! 		       plus_constant (stack_pointer_rtx, c), 1);
      }
  
    if (apply_change_group ())
--- 2241,2249 ----
  	  return 0;
  	}
  
!       validate_change (ml->insn, ml->mem,
! 		       gen_rtx_MEM (GET_MODE (*ml->mem),
! 				    plus_constant (stack_pointer_rtx, c)), 1);
      }
  
    if (apply_change_group ())
*************** combine_stack_adjustments_for_block (bb)
*** 2340,2346 ****
  	  if (last_sp_set && stack_memref_p (src)
  	      && ! reg_mentioned_p (stack_pointer_rtx, dest))
  	    {
! 	      memlist = record_one_stack_memref (insn, src, memlist);
  	      goto processed;
  	    }
  
--- 2341,2347 ----
  	  if (last_sp_set && stack_memref_p (src)
  	      && ! reg_mentioned_p (stack_pointer_rtx, dest))
  	    {
! 	      memlist = record_one_stack_memref (insn, &SET_SRC (set), memlist);
  	      goto processed;
  	    }
  
*************** combine_stack_adjustments_for_block (bb)
*** 2348,2354 ****
  	  if (last_sp_set && stack_memref_p (dest)
  	      && ! reg_mentioned_p (stack_pointer_rtx, src))
  	    {
! 	      memlist = record_one_stack_memref (insn, dest, memlist);
  	      goto processed;
  	    }
  
--- 2349,2356 ----
  	  if (last_sp_set && stack_memref_p (dest)
  	      && ! reg_mentioned_p (stack_pointer_rtx, src))
  	    {
! 	      memlist = record_one_stack_memref (insn, &SET_DEST (set),
! 						 memlist);
  	      goto processed;
  	    }
  

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