This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fortran DW_TAG_module/DW_TAG_imported_{declaration,module} support, improved DW_TAG_common_block support


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]