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] GCSE after reload - resubmit (SPECint +1.5% fp -0.5%).


A resent of the patch with the appropriate ChangeLog entry.
Sorry for the inconvenience.

ChangeLog entry
---------------
2004-03-18  Mostafa Hagog  <mustafa@il.ibm.com>

      * gcse.c (eliminate_partially_redundant_loads): Fix the
      gcc.c-torture/execute/930628-1.c test failure on h8300-elf target.

Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.295
diff -c -3 -p -r1.295 gcse.c
*** gcse.c  4 Mar 2004 16:28:47 -0000     1.295
--- gcse.c  17 Mar 2004 13:41:15 -0000
*************** eliminate_partially_redundant_loads (bas
*** 8321,8328 ****
    dest = SET_DEST (pat);
    /* Check if the loaded register is not used nor killed from the
beginning
       of the block.  */
!   if (reg_used_between_after_reload_p (dest,
!                              PREV_INSN (BB_HEAD (bb)), insn))
      return;

    /* Check potential for replacing load with copy for predecessors.  */
--- 8321,8330 ----
    dest = SET_DEST (pat);
    /* Check if the loaded register is not used nor killed from the
beginning
       of the block.  */
!  if (reg_used_between_after_reload_p (dest,
!                                        PREV_INSN (BB_HEAD (bb)), insn)
!       || reg_set_between_after_reload_p (dest,
!                                          PREV_INSN (BB_HEAD (bb)), insn))
      return;

    /* Check potential for replacing load with copy for predecessors.  */

>
> The attached patch fixes the failure described below.
> Bootstrap and regression passed on powerpc-apple-darwin7.2.0
> and i686-pc-linux-gnu targets.
> Kazu, Thanks for your detailed description that helped locating
> the problem. And for verifying that the fix solved the problem.
>
> Kazu Hirata <kazu@cs.umass.edu> wrote on 11/03/2004 23:27:33:
>
> > Hi Mostafa,
> >
> > Your patch causes gcc.c-torture/execute/930628-1.c to fail on
> > h8300-elf when it is compiled with -ms -O3 -fomit-frame-pointer
> > -funroll-all-loops.
> >
> > Specifying -fno-gcse-after-reload works around the problem.
> >
> > Here is a slightly reduced testcase.  With -fgcse-after-reload,
> > abort() is called.
> >
> > int
> > main (void)
> > {
> >   struct { long f[3]; long x[1][2]; } tp[2][2];
> >   long i, j, ki, kj, mi;
> >   long bdm[2][2][2][2];
> >
> >   for (i = 0; i < 2; i++)
> >     for (j = i; j < 2; j++)
> >       for (ki = 0; ki < 2; ki++)
> >    for (kj = 0; kj < 2; kj++)
> >      if ((j == i) && (ki == kj))
> >        bdm[i][ki][j][kj] = 1000;
> >      else
> >        {
> >          for (mi = 0; mi < 1; mi++)
> >       if (tp[i][ki].x[mi] == tp[j][kj].x[0])
> >         abort ();
> >          bdm[i][ki][j][kj] = 1000;
> >        }
> >
> >   return 0;
> > }
> >
> > Would you mind looking into this?
> >
> > Thanks,
> >
> > Kazu Hirata
>
> (See attached file: gcse-after-reload-bug-fix.patch)[attachment
"gcse-after-
> reload-bug-fix.patch" deleted by Mostafa Hagog/Haifa/IBM]


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