This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: fix PR 23837 (Re: [Bug rtl-optimization/23837] [4.0/4.1 regression] Wrong code with -fschedule-insns)
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: gcc-bugzilla at gcc dot gnu dot org, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 22 Sep 2005 18:36:58 +0100
- Subject: RFA: fix PR 23837 (Re: [Bug rtl-optimization/23837] [4.0/4.1 regression] Wrong code with -fschedule-insns)
- References: <20050912190132.23837.debian-gcc@lists.debian.org> <20050919194257.27337.qmail@sourceware.org>
I have regtested the attached patch on i686-pc-linux-gnu in mainline
from 2005-09-19 18:00 UTC.
2005-09-22 J"orn Rennecke <joern.rennecke@st.com>
PR rtl-optimization/23837
* optabs.c (no_conflict_move_test): Don't set must_stay for a
clobber / clobber match between dest and p->first.
Index: optabs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/optabs.c,v
retrieving revision 1.291
diff -p -r1.291 optabs.c
*** optabs.c 15 Sep 2005 21:51:13 -0000 1.291
--- optabs.c 22 Sep 2005 17:31:13 -0000
*************** no_conflict_move_test (rtx dest, rtx set
*** 3021,3027 ****
return;
/* If this insn sets / clobbers a register that feeds one of the insns
already in the list, this insn has to stay too. */
! else if (reg_mentioned_p (dest, PATTERN (p->first))
|| reg_used_between_p (dest, p->first, p->insn)
/* Likewise if this insn depends on a register set by a previous
insn in the list. */
--- 3021,3028 ----
return;
/* If this insn sets / clobbers a register that feeds one of the insns
already in the list, this insn has to stay too. */
! else if (reg_overlap_mentioned_p (dest, PATTERN (p->first))
! || (CALL_P (p->first) && (find_reg_fusage (p->first, USE, dest)))
|| reg_used_between_p (dest, p->first, p->insn)
/* Likewise if this insn depends on a register set by a previous
insn in the list. */