aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorBud Davis <bdavis9659@sbcglobal.net>2006-11-15 05:10:22 +0000
committerBud Davis <bdavis@gcc.gnu.org>2006-11-15 05:10:22 +0000
commit5868cbf9922413543f1a0f3142232eff43e11f56 (patch)
tree60df5eb822d32866683ff7c963603250f4e57df4 /gcc/fortran/expr.c
parent12c789666901a1e60b362e7ddd05429aa44e1554 (diff)
downloadgcc-5868cbf9922413543f1a0f3142232eff43e11f56.zip
gcc-5868cbf9922413543f1a0f3142232eff43e11f56.tar.gz
gcc-5868cbf9922413543f1a0f3142232eff43e11f56.tar.bz2
re PR fortran/28974 (Extremely slow compilation of enumerated DATA statements.)
2006-11-15 Bud Davis <bdavis9659@sbcglobal.net> PR fortran/28974 * gfortran.h (gfc_expr): Add element which holds a splay-tree for the exclusive purpose of quick access to a constructor by offset. * data.c (find_con_by_offset): Use the splay tree for the search. (gfc_assign_data_value): Use the splay tree. (gfc_assign_data_value_range): ditto. * expr.c (gfc_get_expr): Initialize new element to null. (gfc_free_expr): Delete splay tree when deleting gfc_expr. From-SVN: r118844
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 9c25e5a..96f39c8 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -39,7 +39,7 @@ gfc_get_expr (void)
e->shape = NULL;
e->ref = NULL;
e->symtree = NULL;
-
+ e->con_by_offset = NULL;
return e;
}
@@ -226,7 +226,8 @@ gfc_free_expr (gfc_expr * e)
if (e == NULL)
return;
-
+ if (e->con_by_offset)
+ splay_tree_delete (e->con_by_offset);
free_expr0 (e);
gfc_free (e);
}