This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fortran DW_TAG_module/DW_TAG_imported_{declaration,module} support, improved DW_TAG_common_block support
- From: Tobias Burnus <burnus at net-b dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, Jan Kratochvil <jkratoch at redhat dot com>, Daniel Jacobowitz <dan at codesourcery dot com>
- Date: Wed, 20 Aug 2008 20:58:44 +0200
- Subject: Re: [PATCH] Fortran DW_TAG_module/DW_TAG_imported_{declaration,module} support, improved DW_TAG_common_block support
- References: <20080819144139.GG8107@sunsite.mff.cuni.cz>
Hi,
Jakub Jelinek wrote:
The attached patch adds support for
DW_TAG_{module,imported_{module,declaration}} and improves
support for DW_TAG_common_block (putting all DW_TAG_member
DIEs inside of the DW_TAG_common_block for the same
common block rather than having one DW_TAG_common_block
for each and avoiding the special hacks in dwarf2out.c
Regtested on x86_64-linux.
The Fortran bits look OK and it regtests after replacing gfc_getmem with
ggc_alloc_cleared in gfc_find_module (as you suggested on IRC).
However, somehow also the original symbol is imported. As the
modification at the very bottom shows this leads to wrong debug information.
-------------- aa.f90 ---------------
module m
implicit none
real :: i
end module m
use m, only: j=>i
implicit none
j = 5
end
--------------------------------------
$ ifort aa.f90 <<< OK with the Intel compiler
$ idbc a.out
[...]
(idb) b aa.f90:6
Breakpoint 1 at 0x402c40: file /dev/shm/aa.f90, line 8.
(idb) run
[...]
8 j = 5
(idb) pt i <<<<<< OK, does not exist
No symbol "i" in current context.
(idb) pt j
type = REAL(4)
$ gfortran -g aa.f90 <<<< WRONG with gfortran
$ idbc a.out
[...]
(idb) b aa.f90:6
Breakpoint 1 at 0x402c40: file /dev/shm/aa.f90, line 8.
(idb) run
[...]
(idb) pt i <<<<<<< WRONG: Symbol should NOT exist
type = REAL(4)
(idb) pt j
type = REAL(4)
If one modifies the program to read:
use m, only: j=>i
implicit none
integer :: i
Then for ifort the right thing is printed:
(idb) pt j
type = REAL(4)
(idb) pt i
type = INTEGER(4)
but for gfortran:
(idb) pt i
type = REAL(4) <<<<<< WRONG, it shall be INTEGER(4)
(idb) pt j
type = REAL(4)
Tobias