This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use reversed_comparison_code in sched-deps.c
- From: Richard Earnshaw <rearnsha at buzzard dot freeserve dot co dot uk>
- To: Graham Stott <graham dot stott at btinternet dot com>
- Cc: Richard dot Earnshaw at buzzard dot freeserve dot co dot uk, gcc-patches at gcc dot gnu dot org, rearnsha at buzzard dot freeserve dot co dot uk
- Date: Mon, 30 Aug 2004 01:57:52 +0100
- Subject: Re: [PATCH] Use reversed_comparison_code in sched-deps.c
graham.stott@btinternet.com said:
> This patch breaks bootstraps with RTL checking enabled on i686-pc-linux-gn
> u
> Your changes to get_condition trigget
> crtstuff.c: In function `frame_dummy': crtstuff.c:323: internal compiler
> error: RTL check: access of elt 2 of `eq' with last elt 1 in
> get_condition, at sched-deps.c:156
> This is the offending code
> cond = XEXP (SET_SRC (pc_set (insn)), 0);
> if (XEXP (cond, 2) == pc_rtx)
> return cond;
Argh! Somehow I managed to run the tests with checking disabled.
> All,
>
> Just a follow on while I still awake
>
> Graham Stott wrote:
> > Richard,
>
> >
> > cond = XEXP (SET_SRC (pc_set (insn)), 0);
> > if (XEXP (cond, 2) == pc_rtx)
> ^ I suspect this should be 0
> > return cond;
> >
>
> I'm trying an overnight bootstrap with that change.
No, it's looking inside the if_then_else too soon (I over optimized the
code :-( )
Here's the patch I'm testing now (with checking back on this time)...
Sorry about that.
R.
Index: sched-deps.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.77
diff -p -p -r1.77 sched-deps.c
*** sched-deps.c 29 Aug 2004 21:07:37 -0000 1.77
--- sched-deps.c 30 Aug 2004 00:57:14 -0000
*************** get_condition (rtx insn)
*** 152,163 ****
if (!any_condjump_p (insn) || !onlyjump_p (insn))
return 0;
! cond = XEXP (SET_SRC (pc_set (insn)), 0);
if (XEXP (cond, 2) == pc_rtx)
! return cond;
else if (XEXP (cond, 1) == pc_rtx)
{
! enum rtx_code revcode = reversed_comparison_code (cond, insn);
if (revcode == UNKNOWN)
return 0;
--- 152,166 ----
if (!any_condjump_p (insn) || !onlyjump_p (insn))
return 0;
! cond = SET_SRC (pc_set (insn));
if (XEXP (cond, 2) == pc_rtx)
! return XEXP (cond, 0);
else if (XEXP (cond, 1) == pc_rtx)
{
! enum rtx_code revcode;
!
! cond = XEXP (cond, 0);
! revcode = reversed_comparison_code (cond, insn);
if (revcode == UNKNOWN)
return 0;