From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19986 invoked by alias); 22 Feb 2011 12:01:22 -0000 Received: (qmail 19976 invoked by uid 22791); 22 Feb 2011 12:01:21 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Feb 2011 12:01:16 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47839] ICE in dwarf2out.c:add_AT_specification X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: lto, wrong-debug X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 22 Feb 2011 12:42:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg02579.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47839 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-debug --- Comment #4 from Richard Guenther 2011-02-22 12:01:03 UTC --- With the patch and MODULE PEC_mod CONTAINS SUBROUTINE PECapply(Ex) USE globalvar_mod, ONLY : xstop real(kind=8), dimension(1:xstop), intent(inout) :: Ex write(*,*) xstop END SUBROUTINE PECapply SUBROUTINE PECapply2(Ex) USE globalvar_mod, ONLY : xstop real(kind=8), dimension(1:xstop), intent(inout) :: Ex write(*,*) xstop END SUBROUTINE PECapply2 END MODULE PEC_mod you see pecapply2 (real(kind=8)[0:] * restrict ex) { extern integer(kind=4)D.8 xstopD.1540; { struct __st_parameter_dt dt_parm.0D.1539; dt_parm.0D.1539.commonD.1458.filenameD.1355 = &"t.f90"[1]{lb: 1 sz: 1}; dt_parm.0D.1539.commonD.1458.lineD.1356 = 11; dt_parm.0D.1539.commonD.1458.flagsD.1353 = 128; dt_parm.0D.1539.commonD.1458.unitD.1354 = 6; _gfortran_st_write (&dt_parm.0D.1539); _gfortran_transfer_integer_write (&dt_parm.0D.1539, &xstopD.1538, 4); _gfortran_st_write_done (&dt_parm.0D.1539); } } pecapply (real(kind=8)[0:] * restrict ex) { { struct __st_parameter_dt dt_parm.1D.1543; dt_parm.1D.1543.commonD.1458.filenameD.1355 = &"t.f90"[1]{lb: 1 sz: 1}; dt_parm.1D.1543.commonD.1458.lineD.1356 = 6; dt_parm.1D.1543.commonD.1458.flagsD.1353 = 128; dt_parm.1D.1543.commonD.1458.unitD.1354 = 6; _gfortran_st_write (&dt_parm.1D.1543); _gfortran_transfer_integer_write (&dt_parm.1D.1543, &xstopD.1538, 4); _gfortran_st_write_done (&dt_parm.1D.1543); } } which is half-way sane (same backend-decl used for the actual USE associated variable). But still the 2nd function misses the copy in its BLOCK tree, so I guess if that function would be nested in another that has a local of the same name gdb would confuse references to the USE associated vars with that of the local parent function decl like with MODULE PEC_mod CONTAINS SUBROUTINE test integer :: xstop,xbar write(*,*) xstop CONTAINS SUBROUTINE PECapply(Ex) USE globalvar_mod, ONLY : xstop real(kind=8), dimension(1:xstop), intent(inout) :: Ex write(*,*) xstop,xbar END SUBROUTINE PECapply END SUBROUTINE test SUBROUTINE PECapply2(Ex) USE globalvar_mod, ONLY : xstop real(kind=8), dimension(1:xstop), intent(inout) :: Ex write(*,*) xstop END SUBROUTINE PECapply2 END MODULE PEC_mod remains to a more Fortran affine person to verify the above wrong-debug idea with gdb. The key is pecapply (real(kind=8)[0:] * restrict ex) { { struct __st_parameter_dt dt_parm.1D.1545; dt_parm.1D.1545.commonD.1458.filenameD.1355 = &"t.f90"[1]{lb: 1 sz: 1}; dt_parm.1D.1545.commonD.1458.lineD.1356 = 10; dt_parm.1D.1545.commonD.1458.flagsD.1353 = 128; dt_parm.1D.1545.commonD.1458.unitD.1354 = 6; _gfortran_st_write (&dt_parm.1D.1545); _gfortran_transfer_integer_write (&dt_parm.1D.1545, &xstopD.1535, 4); _gfortran_transfer_integer_write (&dt_parm.1D.1545, &xbarD.1546, 4); _gfortran_st_write_done (&dt_parm.1D.1545); } } (no extern integer(kind=4)D.8 xstopD.1537; here) and in the parent: test () { integer(kind=4)D.8 xbarD.1546; integer(kind=4)D.8 xstopD.1547; static voidD.27 pecapplyD.1541 (real(kind=8)D.18[0:] * restrict); { struct __st_parameter_dt dt_parm.2D.1548; dt_parm.2D.1548.commonD.1458.filenameD.1355 = &"t.f90"[1]{lb: 1 sz: 1}; dt_parm.2D.1548.commonD.1458.lineD.1356 = 5; dt_parm.2D.1548.commonD.1458.flagsD.1353 = 128; dt_parm.2D.1548.commonD.1458.unitD.1354 = 6; _gfortran_st_write (&dt_parm.2D.1548); _gfortran_transfer_integer_write (&dt_parm.2D.1548, &xstopD.1547, 4); _gfortran_st_write_done (&dt_parm.2D.1548); } } we have integer(kind=4)D.8 xstopD.1547 which shadows the global xstop from the module.