aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
authorErik Edelmann <eedelman@gcc.gnu.org>2005-10-30 22:43:45 +0000
committerErik Edelmann <eedelman@gcc.gnu.org>2005-10-30 22:43:45 +0000
commitd48734ef2097ddc561d94a580fc953ee96ce64e9 (patch)
tree102686eae7993678eeae05f49c9be9da67cf827f /gcc/fortran/trans-decl.c
parent097588e4e451fa245febe7d8e8d70e93c4ec7cf4 (diff)
downloadgcc-d48734ef2097ddc561d94a580fc953ee96ce64e9.zip
gcc-d48734ef2097ddc561d94a580fc953ee96ce64e9.tar.gz
gcc-d48734ef2097ddc561d94a580fc953ee96ce64e9.tar.bz2
re PR fortran/18883 (ICE in gfc_finish_var_decl)
fortran/ 2005-10-30 Erik Edelmann <eedelman@gcc.gnu.org> PR fortran/18883 * trans-decl.c (gfc_finish_var_decl): Add decl to the current function, rather than the parent. Make assertion accept fake result variables. * trans-expr.c (gfc_conv_variable): If the character length of an ENTRY isn't set, get the length from the master function instead. testsuite 2005-10-30 Erik Edelmann <eedelman@gcc.gnu.org> PR fortran/18883 * gfortran.dg/char_result_9.f90: New. * gfortran.dg/char_result_10.f90: New. From-SVN: r106254
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index ff69954..dce4095 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -469,7 +469,8 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
function scope. */
if (current_function_decl != NULL_TREE)
{
- if (sym->ns->proc_name->backend_decl == current_function_decl)
+ if (sym->ns->proc_name->backend_decl == current_function_decl
+ || sym->result == sym)
gfc_add_decl_to_function (decl);
else
gfc_add_decl_to_parent_function (decl);
@@ -487,7 +488,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
else if (sym->module && !sym->attr.result && !sym->attr.dummy)
{
/* TODO: Don't set sym->module for result or dummy variables. */
- gcc_assert (current_function_decl == NULL_TREE);
+ gcc_assert (current_function_decl == NULL_TREE || sym->result == sym);
/* This is the declaration of a module variable. */
TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;