[COMMITTED] a68: more ggc fixes

Jose E. Marchesi jemarch@gnu.org
Mon Nov 24 19:00:50 GMT 2025


---
 gcc/algol68/a68-imports.cc         |  2 +-
 gcc/algol68/a68-moids-misc.cc      |  2 +-
 gcc/algol68/a68-parser-keywords.cc |  4 ++--
 gcc/algol68/a68-postulates.cc      |  2 +-
 gcc/algol68/a68-types.h            | 26 +++++++++++++-------------
 gcc/algol68/a68.h                  |  2 +-
 6 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/gcc/algol68/a68-imports.cc b/gcc/algol68/a68-imports.cc
index 2db897dd27c..cfdf8950cb3 100644
--- a/gcc/algol68/a68-imports.cc
+++ b/gcc/algol68/a68-imports.cc
@@ -1033,7 +1033,7 @@ a68_decode_extracts (MOIF_T *moif, encoded_modes_map_t &encoded_modes,
       uint64_t mdextra_size;
       char *name;
 
-      EXTRACT_T *e = (EXTRACT_T *) xmalloc (sizeof (struct EXTRACT_T));
+      EXTRACT_T *e = (EXTRACT_T *) ggc_cleared_alloc<EXTRACT_T> ();
 
       DOFFSET (extract_size);
       extract_end = pos + extract_size;
diff --git a/gcc/algol68/a68-moids-misc.cc b/gcc/algol68/a68-moids-misc.cc
index da33ab09b0c..349c13fd656 100644
--- a/gcc/algol68/a68-moids-misc.cc
+++ b/gcc/algol68/a68-moids-misc.cc
@@ -237,7 +237,7 @@ a68_add_to_soid_list (SOID_T **root, NODE_T *where, SOID_T *soid)
       SOID_T *new_one;
 
       if (A68 (top_soid_list) == NO_SOID)
-	new_one = (SOID_T *) xmalloc (sizeof (SOID_T));
+	new_one = (SOID_T *) ggc_cleared_alloc<SOID_T> ();
       else
 	{
 	  new_one = A68 (top_soid_list);
diff --git a/gcc/algol68/a68-parser-keywords.cc b/gcc/algol68/a68-parser-keywords.cc
index 50f350c1219..7af16082eb9 100644
--- a/gcc/algol68/a68-parser-keywords.cc
+++ b/gcc/algol68/a68-parser-keywords.cc
@@ -60,7 +60,7 @@ a68_add_token (TOKEN_T **p, const char *t)
 	return *p;
     }
 
-  *p = (TOKEN_T *) xmalloc (sizeof (TOKEN_T));
+  *p = (TOKEN_T *) ggc_cleared_alloc<TOKEN_T> ();
   TEXT (*p) = z;
   LESS (*p) = MORE (*p) = NO_TOKEN;
   return *p;
@@ -128,7 +128,7 @@ add_keyword (KEYWORD_T **p, enum a68_attribute a, const char *t)
 	p = &MORE (*p);
     }
 
-  *p = (KEYWORD_T *) xmalloc (sizeof (KEYWORD_T));
+  *p = (KEYWORD_T *) ggc_cleared_alloc<KEYWORD_T> ();
   ATTRIBUTE (*p) = a;
   TEXT (*p) = t;
   LESS (*p) = MORE (*p) = NO_KEYWORD;
diff --git a/gcc/algol68/a68-postulates.cc b/gcc/algol68/a68-postulates.cc
index 35388c332cd..f291205114d 100644
--- a/gcc/algol68/a68-postulates.cc
+++ b/gcc/algol68/a68-postulates.cc
@@ -64,7 +64,7 @@ a68_make_postulate (POSTULATE_T **p, MOID_T *a, MOID_T *b)
     }
   else
     {
-      new_one = (POSTULATE_T *) xmalloc (sizeof (POSTULATE_T));
+      new_one = (POSTULATE_T *) ggc_cleared_alloc<POSTULATE_T> ();
       A68 (new_postulates)++;
     }
 
diff --git a/gcc/algol68/a68-types.h b/gcc/algol68/a68-types.h
index b97b83f8d91..0e9e84436a2 100644
--- a/gcc/algol68/a68-types.h
+++ b/gcc/algol68/a68-types.h
@@ -151,7 +151,7 @@ typedef tree (*LOWERER_T) (struct NODE_T *, struct LOW_CTX_T);
 
 #define NO_LOWERER a68_lower_unimplemented
 
-struct KEYWORD_T
+struct GTY((chain_next ("%h.more"), chain_prev ("%h.less"))) KEYWORD_T
 {
   enum a68_attribute attribute;
   const char *text;
@@ -237,7 +237,7 @@ struct KEYWORD_T
 
 #define NO_MOID ((MOID_T *) 0)
 
-struct GTY(()) MOID_T
+struct GTY((chain_next ("%h.next"))) MOID_T
 {
   int number;
   int attribute;
@@ -302,7 +302,7 @@ struct MODES_T
    NIL_CHECKING indicates whether to check for NIL when dereferencing at
    run-time.  */
 
-struct OPTIONS_T
+struct GTY(()) OPTIONS_T
 {
   enum a68_stropping stropping;
   bool brackets;
@@ -432,7 +432,7 @@ struct OPTIONS_T
    CDECL is a GCC GENERIC tree corresponding to a DECL_FIELD for FIELD
    nodes.  */
 
-struct GTY(()) NODE_T
+struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) NODE_T
 {
   GINFO_T *genie;
   int number;
@@ -498,7 +498,7 @@ struct GTY(()) GINFO_T
   MOID_T *partial_proc, *partial_locale;
 };
 
-struct GTY(()) PACK_T
+struct GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) PACK_T
 {
   MOID_T *type;
   const char *text;
@@ -508,7 +508,7 @@ struct GTY(()) PACK_T
 
 /* Postulates.  */
 
-struct POSTULATE_T
+struct GTY((chain_next ("%h.next"))) POSTULATE_T
 {
   MOID_T *a, *b;
   POSTULATE_T *next;
@@ -516,7 +516,7 @@ struct POSTULATE_T
 
 #define NO_POSTULATE ((POSTULATE_T *) 0)
 
-struct SOID_T
+struct GTY((chain_next ("%h.next"))) SOID_T
 {
   int attribute, sort, cast;
   MOID_T *type;
@@ -524,7 +524,7 @@ struct SOID_T
   SOID_T *next;
 };
 
-struct GTY(()) LINE_T
+struct GTY((chain_next ("%h.next"))) LINE_T
 {
   char marker[6], *string;
   const char *filename;
@@ -611,7 +611,7 @@ struct GTY(()) TABLE_T
    LOWERER is a lowering routine defined in a68-low-prelude.cc.  These are used
    in taxes that denote some pre-defined operator.  */
 
-struct GTY(()) TAG_T
+struct GTY((chain_next ("%h.next"))) TAG_T
 {
   TABLE_T *symbol_table;
   MOID_T *type;
@@ -629,14 +629,14 @@ struct GTY(()) TAG_T
 };
 #define NO_TAG ((TAG_T *) 0)
 
-struct TOKEN_T
+struct GTY((chain_next ("%h.more"), chain_prev ("%h.less"))) TOKEN_T
 {
   char *text;
   TOKEN_T *less, *more;
 };
 #define NO_TOKEN ((TOKEN_T *) 0)
 
-struct MODULE_T
+struct GTY(()) MODULE_T
 {
   bool tree_listing_safe, cross_reference_safe;
   int error_count, warning_count, source_scan;
@@ -644,7 +644,7 @@ struct MODULE_T
   MOID_T *top_moid, *standenv_moid;
   NODE_T *top_node;
   OPTIONS_T options;
-  FILE *file_source_fd;
+  FILE * GTY ((skip)) file_source_fd;
   const char *file_source_name;
   struct
   {
@@ -842,7 +842,7 @@ struct PARSER_T
    Directories are added to the list at the option handling language hook.  The
    list is searched in FIFO order.  */
 
-struct A68_T
+struct GTY(()) A68_T
 {
   BUFFER output_line;
   BUFFER edit_line;
diff --git a/gcc/algol68/a68.h b/gcc/algol68/a68.h
index 6f8fb42cbe3..7032cf94e9f 100644
--- a/gcc/algol68/a68.h
+++ b/gcc/algol68/a68.h
@@ -109,7 +109,7 @@ enum
 
 /* Front-end global state.  */
 
-extern A68_T a68_common;
+extern GTY(()) A68_T a68_common;
 #define A68(z)             (a68_common.z)
 #define A68_JOB            A68 (job)
 #define A68_STANDENV       A68 (standenv)
-- 
2.30.2



More information about the Algol68 mailing list