aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/f95-lang.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2005-10-12 08:18:12 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-10-12 08:18:12 +0200
commit81871c2a0501a25b3f038286268e0ce84936fdf2 (patch)
tree178dc578bf72c1c0badbd660ff2e0ed2e152ac89 /gcc/fortran/f95-lang.c
parent595cf76b1f7e63889c5a0cc9b09163c0264d2e25 (diff)
downloadgcc-81871c2a0501a25b3f038286268e0ce84936fdf2.zip
gcc-81871c2a0501a25b3f038286268e0ce84936fdf2.tar.gz
gcc-81871c2a0501a25b3f038286268e0ce84936fdf2.tar.bz2
trans-common.c (build_field): Fix comment typo.
* 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. From-SVN: r105288
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 9056cd2..d7bc19b 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);
}