public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dave Love <d.love@dl.ac.uk>
To: egcs@cygnus.com
Subject: Re: g77 assumed array patch [was: fortran regression]
Date: Fri, 19 Dec 1997 12:37:00 -0000	[thread overview]
Message-ID: <rzq67olfehu.fsf@djlvig.dl.ac.uk> (raw)
In-Reply-To: <24592.882516126@hurl.cygnus.com>

>>>>> "Jeffrey" == Jeffrey A Law <law@cygnus.com> writes:

 Jeffrey> I do worry a little about the "hope debuggers can deal"
 Jeffrey> issues with an unspecified high bound.  Maybe we should set
 Jeffrey> an artificial one if some debuggers don't handle unspecified
 Jeffrey> bounds correctly.

Well, gdb definitely still can't cope with the debugging info
produced, though the bound now appears as -1 rather than 2147483647.

FWIW, this with g77 -g using the rth patch:
      real a(10)
      do i=1,10
        a(i)=i
      end do
      call foo(a)
      end
      subroutine foo(a)
      real a(*)
      print *, a(1)
      end

produces:

Breakpoint 2, foo_ (a=0xbffff590) at /tmp/x.f:9
9             print *, a(1)
Current language:  auto; currently fortran
(gdb) whatis a
type = PTR TO -> ( real*4 (-1))
(gdb) set lang c
Warning: the current language does not match this frame.
(gdb) p a[1]
Segmentation fault
$

If I compile the same thing with (an old) sunpro f77 on sunos4
(stabs), gdb will show me something sensible (which I didn't expect :-)):

Breakpoint 2, foo (a=()) at x.f:9
9             print *, a(1)
(gdb) whatis a
type = real*4 (0:-1)
(gdb) p a
$1 = ()
(gdb) p a(1)
$2 = 1
(gdb) 

I don't remember what gdb is doing here (or expecting) in the the g77
case, though I did follow it once.  gdb's fortran conventions are
those of some motorola compiler AFAIK.  [You can't use `p a(1)' with
lang fortran on the g77 output because it's interpreted as a function
call.]

I'll be happy to help sort it out if anyone has good ideas how to
proceed.  There are some other problems with g77 debugging info which
probably need to be sorted out in the backend; bits of the fortran
frontend currently use symbols like
IF_SOMEONE_GETS_DEBUGGING_SUPPORT_WORKING :-(.

      reply	other threads:[~1997-12-19 12:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-10  7:08 Results for egcs-971207 on m68k-next-nextstep3 Toon Moene
1997-12-10 13:36 ` fortran regression [was Re: Results for egcs-971207 on m68k-next-nextstep3] Dave Love
1997-12-10 16:43   ` Jeffrey A Law
1997-12-11 11:14     ` Dave Love
1997-12-11 16:33       ` Craig Burley
1997-12-12 10:18         ` Dave Love
1997-12-12 18:04           ` Craig Burley
     [not found]         ` <rzqd8j2zb5m.fsf.cygnus.egcs@djlvig.dl.ac.uk>
1997-12-12 15:46           ` Jason Merrill
1997-12-13 10:44             ` Dave Love
1997-12-15 23:18         ` g77 assumed array patch [was: fortran regression] Richard Henderson
1997-12-18 23:19           ` Jeffrey A Law
1997-12-19 12:37             ` Dave Love [this message]

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=rzq67olfehu.fsf@djlvig.dl.ac.uk \
    --to=d.love@dl.ac.uk \
    --cc=egcs@cygnus.com \
    /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).