trans-common.c (create_common): Add decl to function chain to preserve identifier...
authorGeorge Helffrich <george@gcc.gnu.org>
Tue, 1 Apr 2008 21:23:36 +0000 (21:23 +0000)
committerGeorge Helffrich <george@gcc.gnu.org>
Tue, 1 Apr 2008 21:23:36 +0000 (21:23 +0000)
commit7151ffbe56dd95cbd05e4e5c418468d30dc33c2f
tree803082c66137124abad95c71d051d7b2b08a3878
parentdc197ab91c79219326ebc83e7353ac4f925e78e5
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
12 files changed:
gcc/ChangeLog
gcc/dbxout.c
gcc/dwarf2out.c
gcc/fortran/ChangeLog
gcc/fortran/trans-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/pr35154.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/debug/debug.exp [new file with mode: 0644]
gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f [new file with mode: 0644]
gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f [new file with mode: 0644]
gcc/testsuite/gfortran.dg/debug/trivial.f [new file with mode: 0644]
gcc/testsuite/lib/gfortran-dg.exp