diff options
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 20253e6..1b47f267 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -704,7 +704,7 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym) layout_type (type); } - if (nest || write_symbols == NO_DEBUG) + if (write_symbols == NO_DEBUG) return; if (TYPE_NAME (type) != NULL_TREE @@ -1761,7 +1761,7 @@ build_entry_thunks (gfc_namespace * ns) thunk_fndecl = thunk_sym->backend_decl; - gfc_start_block (&body); + gfc_init_block (&body); /* Pass extra parameter identifying this entry point. */ tmp = build_int_cst (gfc_array_index_type, el->id); @@ -1869,8 +1869,12 @@ build_entry_thunks (gfc_namespace * ns) /* Finish off this function and send it for code generation. */ DECL_SAVED_TREE (thunk_fndecl) = gfc_finish_block (&body); + tmp = getdecls (); poplevel (1, 0, 1); BLOCK_SUPERCONTEXT (DECL_INITIAL (thunk_fndecl)) = thunk_fndecl; + DECL_SAVED_TREE (thunk_fndecl) + = build3_v (BIND_EXPR, tmp, DECL_SAVED_TREE (thunk_fndecl), + DECL_INITIAL (thunk_fndecl)); /* Output the GENERIC tree. */ dump_function (TDI_original, thunk_fndecl); @@ -3652,7 +3656,7 @@ gfc_generate_function_code (gfc_namespace * ns) trans_function_start (sym); - gfc_start_block (&block); + gfc_init_block (&block); if (ns->entries && ns->proc_name->ts.type == BT_CHARACTER) { @@ -3886,11 +3890,16 @@ gfc_generate_function_code (gfc_namespace * ns) saved_function_decls = NULL_TREE; DECL_SAVED_TREE (fndecl) = gfc_finish_block (&block); + decl = getdecls (); /* Finish off this function and send it for code generation. */ poplevel (1, 0, 1); BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl; + DECL_SAVED_TREE (fndecl) + = build3_v (BIND_EXPR, decl, DECL_SAVED_TREE (fndecl), + DECL_INITIAL (fndecl)); + /* Output the GENERIC tree. */ dump_function (TDI_original, fndecl); @@ -3969,9 +3978,13 @@ gfc_generate_constructors (void) DECL_SAVED_TREE (fndecl) = build_stmt (EXPR_STMT, tmp); } + decl = getdecls (); poplevel (1, 0, 1); BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl; + DECL_SAVED_TREE (fndecl) + = build3_v (BIND_EXPR, decl, DECL_SAVED_TREE (fndecl), + DECL_INITIAL (fndecl)); free_after_parsing (cfun); free_after_compilation (cfun); |