summaryrefslogtreecommitdiff
path: root/gcc/fortran/f95-lang.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-12 06:18:12 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-12 06:18:12 +0000
commitdd4aa760b5b0e62792de1b1815e129f82e73bf98 (patch)
tree178dc578bf72c1c0badbd660ff2e0ed2e152ac89 /gcc/fortran/f95-lang.c
parent317330f73fccd66a707c12f2d4c8d0fe9216aecf (diff)
downloadgcc-dd4aa760b5b0e62792de1b1815e129f82e73bf98.tar.gz
* trans-common.c (build_field): Fix comment typo.
(create_common): Set backend_decl of COMMON or EQUIVALENCEd variables to a VAR_DECL with the COMPONENT_REF in DECL_HAS_VALUE_EXPR rather than COMPONENT_REF directly. * f95-lang.c (gfc_expand_function): Emit debug info for EQUIVALENCEd variables if the equiv union is going to be output. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105288 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/f95-lang.c')
-rw-r--r--gcc/fortran/f95-lang.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 9056cd29ca4..d7bc19b0b4f 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -187,6 +187,36 @@ tree *ridpointers = NULL;
static void
gfc_expand_function (tree fndecl)
{
+ tree t;
+
+ if (DECL_INITIAL (fndecl)
+ && BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl)))
+ {
+ /* Local static equivalenced variables are never seen by
+ check_global_declarations, so we need to output debug
+ info by hand. */
+
+ t = BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl));
+ for (t = BLOCK_VARS (t); t; t = TREE_CHAIN (t))
+ if (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t)
+ && TREE_STATIC (t))
+ {
+ tree expr = DECL_VALUE_EXPR (t);
+
+ if (TREE_CODE (expr) == COMPONENT_REF
+ && TREE_CODE (TREE_OPERAND (expr, 0)) == VAR_DECL
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0)))
+ == UNION_TYPE
+ && cgraph_varpool_node (TREE_OPERAND (expr, 0))->needed
+ && errorcount == 0 && sorrycount == 0)
+ {
+ timevar_push (TV_SYMOUT);
+ (*debug_hooks->global_decl) (t);
+ timevar_pop (TV_SYMOUT);
+ }
+ }
+ }
+
tree_rest_of_compilation (fndecl);
}