From 7151ffbe56dd95cbd05e4e5c418468d30dc33c2f Mon Sep 17 00:00:00 2001 From: George Helffrich Date: Tue, 1 Apr 2008 21:23:36 +0000 Subject: trans-common.c (create_common): Add decl to function chain to preserve identifier scope in debug output. * fortran/trans-common.c (create_common): Add decl to function chain to preserve identifier scope in debug output. * dbxout.c: Emit .stabs debug info for Fortran COMMON block variables as base symbol name + offset using N_BCOMM/N_ECOMM. (is_fortran, dbxout_common_name, dbxout_common_check): New functions. (dbxout_symbol_location): Transform N_LCSYM to N_GSYM for storage in common. (dbxout_syms): Check for COMMON-based symbol and wrap in N_BCOMM/N_ECOMM stab bracket, including as many symbols as possible in bracket for efficiency. * dwarf2out.c: Emit DWARF debug info for Fortran COMMON block using DW_TAG_common_block + member offset. (add_pubname_string): New function. (dw_expand_expr): New function to find block name and offset for COMMON var. (common_check): New function to check whether symbol in Fortran COMMON. (gen_variable_die): If COMMON, use DW_TAG_common_block. * testsuite/gcc.dg/debug/pr35154.c: New test to check that non-Fortran use of common is unchanged. * testsuite/lib/gfortran-dg.exp: New harness to compile Fortran progs with all combinations of debug options available on target. * testsuite/gfortran.dg/debug/debug.exp: Ditto. * testsuite/gfortran.dg/debug/trivial.f: Ditto. * testsuite/gfortran.dg/debug/pr35154-stabs.f: New test case for .stabs functionality. * testsuite/gfortran.dg/debug/pr35154-dwarf2.f: New test case for DWARF functionality. From-SVN: r133801 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-common.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index cd69cba..9fb19c4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2008-04-01 George Helffrich + + * trans-common.c (create_common): Add decl to function + chain to preserve identifier scope in debug output. + 2008-04-01 Joseph Myers * gfortran.texi: Include gpl_v3.texi instead of gpl.texi diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 7086a6c..f7042cb 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -687,10 +687,7 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) /* This is a fake variable just for debugging purposes. */ TREE_ASM_WRITTEN (var_decl) = 1; - if (com) - var_decl = pushdecl_top_level (var_decl); - else - gfc_add_decl_to_function (var_decl); + gfc_add_decl_to_function (var_decl); SET_DECL_VALUE_EXPR (var_decl, fold_build3 (COMPONENT_REF, TREE_TYPE (s->field), -- cgit v1.1