public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/47839] ICE in dwarf2out.c:add_AT_specification
Date: Tue, 22 Feb 2011 12:42:00 -0000	[thread overview]
Message-ID: <bug-47839-4-KLfAsi92J8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47839-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47839

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-debug

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 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.


  parent reply	other threads:[~2011-02-22 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 16:55 [Bug fortran/47839] New: " rguenth at gcc dot gnu.org
2011-02-21 16:56 ` [Bug fortran/47839] " rguenth at gcc dot gnu.org
2011-02-21 17:14 ` rguenth at gcc dot gnu.org
2011-02-22 11:56 ` rguenth at gcc dot gnu.org
2011-02-22 12:42 ` rguenth at gcc dot gnu.org [this message]
2011-02-24 10:35 ` rguenth at gcc dot gnu.org
2011-02-24 10:39 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-47839-4-KLfAsi92J8@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).