This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: enabling 1st insn scheduling for sh4.


DJ Delorie wrote:

First guess: there's already a stack adjust between the call and the
set (they're emitted in that order). Would that confuse it enough?



Here's a quick-n-dirty patch to look for such adjustments, which seems to work for the one failure I saw (otherwise untested). So, it does look like the stack adjust is confusing it :-P

Index: sched-deps.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.68
diff -p -C2 -r1.68 sched-deps.c
*** sched-deps.c	3 Feb 2004 05:39:53 -0000	1.68
--- sched-deps.c	26 Feb 2004 06:20:32 -0000
*************** sched_analyze_insn (struct deps *deps, r
*** 1128,1132 ****
       if (GET_CODE (tmp) == SUBREG)
 	tmp = SUBREG_REG (tmp);
!       if (GET_CODE (tmp) == REG)
 	src_regno = REGNO (tmp);
       else
--- 1128,1137 ----
       if (GET_CODE (tmp) == SUBREG)
 	tmp = SUBREG_REG (tmp);
!       if (GET_CODE (tmp) == PLUS
! 	  && GET_CODE (XEXP (tmp, 0)) == REG
! 	  && REGNO (XEXP (tmp, 0)) == dest_regno
! 	  && dest_regno == STACK_POINTER_REGNUM)
! 	src_regno = dest_regno;
!       else if (GET_CODE (tmp) == REG)
 	src_regno = REGNO (tmp);
       else



Could you send me all call sequence (call, stack adjustment, the set from r0 just before insn scheduler). I'll probably approve the patch. I just think that the source could be more general (more general expression not just plus).

Vlad



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