From c3bdeea8f3a629555c7de26b2f49079b01b7a6fc Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Tue, 26 Apr 2005 04:11:56 +0000 Subject: [PATCH] sched-deps.c (sched_analyze_1): On STACK_REGS targets... * sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat all writes to any stack register as a read/write dependency on FIRST_STACK_REG. (sched_analyze_2): Likewise, for reads from any stack register. From-SVN: r98762 --- gcc/ChangeLog | 7 +++++++ gcc/sched-deps.c | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44b5d65e7fc..06506ed977e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-04-25 Roger Sayle + + * sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat + all writes to any stack register as a read/write dependency on + FIRST_STACK_REG. + (sched_analyze_2): Likewise, for reads from any stack register. + 2005-04-25 Richard Henderson * final.c (output_addr_const): Revert 2005-04-09 change. diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 933d74da60c..6b54fc8fd93 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -534,6 +534,15 @@ sched_analyze_1 (struct deps *deps, rtx x, rtx insn) { regno = REGNO (dest); +#ifdef STACK_REGS + /* Treat all writes to a stack register as modifying the TOS. */ + if (regno >= FIRST_STACK_REG && regno <= LAST_STACK_REG) + { + SET_REGNO_REG_SET (reg_pending_uses, FIRST_STACK_REG); + regno = FIRST_STACK_REG; + } +#endif + /* A hard reg in a wide mode may really be multiple registers. If so, mark all of them just like the first. */ if (regno < FIRST_PSEUDO_REGISTER) @@ -684,6 +693,16 @@ sched_analyze_2 (struct deps *deps, rtx x, rtx insn) case REG: { int regno = REGNO (x); + +#ifdef STACK_REGS + /* Treat all reads of a stack register as modifying the TOS. */ + if (regno >= FIRST_STACK_REG && regno <= LAST_STACK_REG) + { + SET_REGNO_REG_SET (reg_pending_sets, FIRST_STACK_REG); + regno = FIRST_STACK_REG; + } +#endif + if (regno < FIRST_PSEUDO_REGISTER) { int i = hard_regno_nregs[regno][GET_MODE (x)];