summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog14
-rw-r--r--gcc/fortran/f95-lang.c3
-rw-r--r--gcc/fortran/trans-decl.c6
-rw-r--r--gcc/fortran/trans-types.c8
-rw-r--r--gcc/fortran/trans.h7
5 files changed, 27 insertions, 11 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index edb50382ee1..10fe680f6f4 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,17 @@
+2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
+
+ * trans-types.c (gfc_get_nodesc_array_type): Use typed GC
+ allocation.
+ (gfc_get_array_type_bounds): Likewise.
+
+ * trans-decl.c (gfc_allocate_lang_decl): Likewise.
+ (gfc_find_module): Likewise.
+
+ * f95-lang.c (pushlevel): Likewise.
+
+ * trans.h (struct lang_type): Add variable_size GTY option.
+ (struct lang_decl): Likewise.
+
2010-06-08 Tobias Burnus <burnus@net-b.de>
PR fortran/44446
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 14525dc2552..f76e75c4b1f 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -350,8 +350,7 @@ getdecls (void)
void
pushlevel (int ignore ATTRIBUTE_UNUSED)
{
- struct binding_level *newlevel
- = (struct binding_level *) ggc_alloc (sizeof (struct binding_level));
+ struct binding_level *newlevel = ggc_alloc_binding_level ();
*newlevel = clear_binding_level;
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 224474aeff2..7ebdac4d1cf 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -612,8 +612,8 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
void
gfc_allocate_lang_decl (tree decl)
{
- DECL_LANG_SPECIFIC (decl) = (struct lang_decl *)
- ggc_alloc_cleared (sizeof (struct lang_decl));
+ DECL_LANG_SPECIFIC (decl) = ggc_alloc_cleared_lang_decl(sizeof
+ (struct lang_decl));
}
/* Remember a symbol to generate initialization/cleanup code at function
@@ -3410,7 +3410,7 @@ gfc_find_module (const char *name)
htab_hash_string (name), INSERT);
if (*slot == NULL)
{
- struct module_htab_entry *entry = GGC_CNEW (struct module_htab_entry);
+ struct module_htab_entry *entry = ggc_alloc_cleared_module_htab_entry ();
entry->name = gfc_get_string (name);
entry->decls = htab_create_ggc (10, module_htab_decls_hash,
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index d794c2fb668..38bae7d4cea 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -1390,8 +1390,8 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed,
type = make_node (ARRAY_TYPE);
GFC_ARRAY_TYPE_P (type) = 1;
- TYPE_LANG_SPECIFIC (type) = (struct lang_type *)
- ggc_alloc_cleared (sizeof (struct lang_type));
+ TYPE_LANG_SPECIFIC (type)
+ = ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
known_stride = (packed != PACKED_NO);
known_offset = 1;
@@ -1631,8 +1631,8 @@ gfc_get_array_type_bounds (tree etype, int dimen, int codimen, tree * lbound,
TYPE_NAME (fat_type) = get_identifier (name);
GFC_DESCRIPTOR_TYPE_P (fat_type) = 1;
- TYPE_LANG_SPECIFIC (fat_type) = (struct lang_type *)
- ggc_alloc_cleared (sizeof (struct lang_type));
+ TYPE_LANG_SPECIFIC (fat_type)
+ = ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
GFC_TYPE_ARRAY_RANK (fat_type) = dimen;
GFC_TYPE_ARRAY_DTYPE (fat_type) = NULL_TREE;
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 9ee81480c5b..72f8a436788 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -630,7 +630,10 @@ enum gfc_array_kind
};
/* Array types only. */
-struct GTY(()) lang_type {
+/* FIXME: the variable_size annotation here is needed because these types are
+ variable-sized in some other frontends. Due to gengtype deficiency the GTY
+ options of such types have to agree across all frontends. */
+struct GTY((variable_size)) lang_type {
int rank;
enum gfc_array_kind akind;
tree lbound[GFC_MAX_DIMENSIONS];
@@ -644,7 +647,7 @@ struct GTY(()) lang_type {
tree base_decl[2];
};
-struct GTY(()) lang_decl {
+struct GTY((variable_size)) lang_decl {
/* Dummy variables. */
tree saved_descriptor;
/* Assigned integer nodes. Stringlength is the IO format string's length.