aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-common.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2005-03-12 22:44:44 +0100
committerTobias Schlüter <tobi@gcc.gnu.org>2005-03-12 22:44:44 +0100
commitbae88af67e2175f50b8f278b373b911762249734 (patch)
tree28c0b703dc3ba7d95e02c234669e802d5c8227ef /gcc/fortran/trans-common.c
parent7d3bf067e90674708a69c8b838b4ad7c2caf98c7 (diff)
downloadgcc-bae88af67e2175f50b8f278b373b911762249734.zip
gcc-bae88af67e2175f50b8f278b373b911762249734.tar.gz
gcc-bae88af67e2175f50b8f278b373b911762249734.tar.bz2
re PR fortran/20361 (-fmax-stack-var-size=N not working for equivalence)
fortran/ PR fortran/20361 * trans-array.c (gfc_stack_space_left): Remove unused variable. (gfc_can_put_var_on_stack): Move to trans-decl.c, remove #if 0'ed code. * trans-array.h (gfc_stack_space_left, gfc_can_put_var_on_stack): Remove declaration / prototype. * trans-common.c (build_equiv_decl): Give union a name. Check if it can be put on the stack. * trans-decl.c (gfc_stack_space_left): Move function here. (gfc_build_qualified_array): Fix comment typo. * trans.h (gfc_put_var_on_stack): Add prototype. testsuite/ PR fortran/20361 * gfortran.dg/largeequiv_1.f90: New test. From-SVN: r96352
Diffstat (limited to 'gcc/fortran/trans-common.c')
-rw-r--r--gcc/fortran/trans-common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 35ea801..c62d68d 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -252,6 +252,8 @@ static tree
build_equiv_decl (tree union_type, bool is_init)
{
tree decl;
+ char name[15];
+ static int serial = 0;
if (is_init)
{
@@ -260,10 +262,13 @@ build_equiv_decl (tree union_type, bool is_init)
return decl;
}
- decl = build_decl (VAR_DECL, NULL, union_type);
+ snprintf (name, sizeof (name), "equiv.%d", serial++);
+ decl = build_decl (VAR_DECL, get_identifier (name), union_type);
DECL_ARTIFICIAL (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
- DECL_COMMON (decl) = 1;
+ if (!gfc_can_put_var_on_stack (DECL_SIZE_UNIT (decl)))
+ TREE_STATIC (decl) = 1;
TREE_ADDRESSABLE (decl) = 1;
TREE_USED (decl) = 1;