Let's backport speedups from 3.4 to 3.3

Karel Gardas kgardas@objectsecurity.com
Wed Feb 12 21:07:00 GMT 2003


On Thu, 13 Feb 2003, Kaoru Fukui wrote:

> > http://gcc.gnu.org/ml/gcc-patches/2003-02/msg00377.html
> > http://gcc.gnu.org/ml/gcc-patches/2003-02/msg00560.htm
> > There is Mike's info.
> >
> >
> > I tried popcontext-fsf-2.diffs which is speedy, see below
> >
> > http://gcc.gnu.org/ml/gcc-patches/2003-02/msg00380.html
> > gcc-3.3 doesn't pch, so it needs to adjust.
>
> This is my adjusted Mike's patch for gcc-3.3.
>

Sorry, but I'm not able to patch my todays gcc3.3 sources:

thinkpad:~/cvs/gcc/gcc33-test/gcc$ patch < /tmp/gcc33-patch
patching file varray.c
Hunk #1 succeeded at 27 (offset -2 lines).
Hunk #2 succeeded at 64 (offset -2 lines).
Hunk #3 succeeded at 89 (offset -2 lines).
Hunk #4 succeeded at 110 (offset -2 lines).
patching file varray.h
Hunk #1 succeeded at 55 (offset -2 lines).
patching file ggc-page.c
Hunk #1 succeeded at 24 (offset -2 lines).
Hunk #2 succeeded at 238 (offset -14 lines).
Hunk #3 succeeded at 299 (offset -14 lines).
Hunk #4 succeeded at 348 (offset -20 lines).
Hunk #5 succeeded at 378 (offset -20 lines).
Hunk #6 succeeded at 400 (offset -20 lines).
Hunk #7 succeeded at 409 (offset -20 lines).
Hunk #8 succeeded at 937 (offset -22 lines).
Hunk #9 succeeded at 977 (offset -22 lines).
Hunk #10 succeeded at 1126 (offset -22 lines).
Hunk #11 succeeded at 1437 (offset -22 lines).
Hunk #12 succeeded at 1483 (offset -22 lines).
Hunk #13 FAILED at 1501.
Hunk #14 succeeded at 1507 with fuzz 2 (offset -31 lines).
Hunk #15 succeeded at 1574 (offset -31 lines).
Hunk #16 succeeded at 1608 (offset -32 lines).
Hunk #17 succeeded at 1835 with fuzz 2 (offset -241 lines).
Hunk #18 FAILED at 1910.
Hunk #19 FAILED at 1947.
Hunk #20 FAILED at 1981.
4 out of 20 hunks FAILED -- saving rejects to file ggc-page.c.rej
thinkpad:~/cvs/gcc/gcc33-test/gcc$

Any problem with gcc-page.c?

Thanks,

Karel
PS: rejects look:

***************
*** 1256,1262 ****
  ggc_pop_context ()
  {
    unsigned long omask;
!   unsigned order, depth;

    depth = --G.context_depth;
    omask = (unsigned long)1 << (depth + 1);
--- 1501,1510 ----
  ggc_pop_context ()
  {
    unsigned long omask;
!   unsigned depth, i, e;
! #ifdef ENABLE_CHECKING
!   unsigned order;
! #endif

    depth = --G.context_depth;
    omask = (unsigned long)1 << (depth + 1);
***************
*** 1544,1552 ****
    struct ggc_pch_ondisk d;
    unsigned i;
    char *offs = addr;
!
!   /* We've just read in a PCH file.  So, every object that used to be allocated
!      is now free.  */
    clear_marks ();
  #ifdef GGC_POISON
    poison_pages ();
--- 1910,1922 ----
    struct ggc_pch_ondisk d;
    unsigned i;
    char *offs = addr;
!   unsigned long count_old_page_tables;
!   unsigned long count_new_page_tables;
!
!   count_old_page_tables = GGC_VARRAY_ACTIVE_SIZE (G.by_depth);
!
!   /* We've just read in a PCH file.  So, every object that used to be
!      allocated is now free.  */
    clear_marks ();
  #ifdef GGC_POISON
    poison_pages ();
***************
*** 1577,1586 ****
        size_t bytes;
        size_t num_objs;
        size_t j;
!
        if (d.totals[i] == 0)
  	continue;
!
        bytes = ROUND_UP (d.totals[i] * OBJECT_SIZE (i), G.pagesize);
        num_objs = bytes / OBJECT_SIZE (i);
        entry = xcalloc (1, (sizeof (struct page_entry)
--- 1947,1956 ----
        size_t bytes;
        size_t num_objs;
        size_t j;
!
        if (d.totals[i] == 0)
  	continue;
!
        bytes = ROUND_UP (d.totals[i] * OBJECT_SIZE (i), G.pagesize);
        num_objs = bytes / OBJECT_SIZE (i);
        entry = xcalloc (1, (sizeof (struct page_entry)
***************
*** 1611,1617 ****
        else
  	G.pages[i] = entry;
        G.page_tails[i] = entry;
      }

    /* Update the statistics.  */
    G.allocated = G.allocated_last_gc = offs - (char *)addr;
--- 1981,2002 ----
        else
  	G.pages[i] = entry;
        G.page_tails[i] = entry;
+
+       /* We start off by just adding all the new information to the
+ 	 end of the varrays, later, we will move the new information
+ 	 to the front of the varrays, as the PCH page tables are at
+ 	 context 0.  */
+       GGC_VARRAY_PUSH_GENERIC_PTRNGC (G.by_depth, entry);
+       GGC_VARRAY_PUSH_GENERIC_PTRNGC (G.save_in_use, 0);
      }
+
+   /* Now, we update the various data structures that speed page table
+      handling.  */
+
+   count_new_page_tables = GGC_VARRAY_ACTIVE_SIZE (G.by_depth)
+     - count_old_page_tables;
+
+   move_ptes_to_front (count_old_page_tables, count_new_page_tables);

    /* Update the statistics.  */
    G.allocated = G.allocated_last_gc = offs - (char *)addr;
--
Karel Gardas                  kgardas@objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com



More information about the Gcc mailing list