[gc-improv] Convert PA backend

Laurynas Biveinis laurynas.biveinis@gmail.com
Tue Dec 8 15:26:00 GMT 2009


Almost as boring as the other ones, but with the PA backed the last
ggc_resize reference goes away, thus deleting its definition.
Bootstrapped and regtested under hppa2.0-unknown-linux-gnu, committed
to gc-improv.

2009-12-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

        * ggc.h (ggc_realloc): Remove.

        * config/pa/pa.c (pa_init_machine_status): Use typed GC allocation.
        (get_deferred_plabel): Use typed GC allocation.  Replace
        ggc_realloc with GGC_RESIZEVEC.

-- 
Laurynas

Index: ggc.h
===================================================================
--- ggc.h       (revision 155023)
+++ ggc.h       (working copy)
@@ -163,8 +163,6 @@
 /* Resize a block.  */
 extern void *ggc_realloc_stat (void *, size_t MEM_STAT_DECL);

-#define ggc_realloc(s,z) ggc_realloc_stat (s,z MEM_STAT_INFO)
-
 /* Free a block.  To be used when known for certain it's not reachable.  */
 extern void ggc_free (void *);

Index: ChangeLog.gc-improv
===================================================================
--- ChangeLog.gc-improv (revision 155023)
+++ ChangeLog.gc-improv (working copy)
@@ -1,3 +1,11 @@
+2009-12-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
+
+       * ggc.h (ggc_realloc): Remove.
+
+       * config/pa/pa.c (pa_init_machine_status): Use typed GC allocation.
+       (get_deferred_plabel): Use typed GC allocation.  Replace
+       ggc_realloc with GGC_RESIZEVEC.
+
 2009-11-30  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

        * config/ia64/ia64.c (ia64_init_machine_status): Use typed GC
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c      (revision 155023)
+++ config/pa/pa.c      (working copy)
@@ -556,7 +556,7 @@
 static struct machine_function *
 pa_init_machine_status (void)
 {
-  return GGC_CNEW (machine_function);
+  return ggc_alloc_cleared_machine_function ();
 }

 /* If FROM is a probable pointer register, mark TO as a probable
@@ -5379,13 +5379,11 @@
       tree id;

       if (deferred_plabels == 0)
-       deferred_plabels = (struct deferred_plabel *)
-         ggc_alloc (sizeof (struct deferred_plabel));
+       deferred_plabels =  ggc_alloc_deferred_plabel ();
       else
-       deferred_plabels = (struct deferred_plabel *)
-         ggc_realloc (deferred_plabels,
-                      ((n_deferred_plabels + 1)
-                       * sizeof (struct deferred_plabel)));
+        deferred_plabels = GGC_RESIZEVEC (struct deferred_plabel,
+                                          deferred_plabels,
+                                          n_deferred_plabels + 1);

       i = n_deferred_plabels++;
       deferred_plabels[i].internal_label = gen_label_rtx ();



More information about the Gcc-patches mailing list