public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/95847] [9/10/11 Regression] Internal error when processing pFUnit generated files with --coverage
Date: Thu, 05 Nov 2020 19:51:07 +0000	[thread overview]
Message-ID: <bug-95847-4-XrrvLmbOoN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95847-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95847

--- Comment #6 from kargl at gcc dot gnu.org ---
(In reply to Martin Liška from comment #5)
> I can only confirm it's a Fortran issue.
> Can please anybody from Fortran folks take a look?

First, the caveat, the Fortran code in the attached
example is invalid so a compiler can to do whatever
it wants, including dying with an ICE.

Split the example code into a file with only the 
module (say, d.f90) and a file with only the
function foo_suite (say, e.f90).  I get

% gfcx -c --coverage d.f90
% gfcx -c --coverage e.f90

with no ICE.  It seems that the strengthen assumption in
the git commit gets confused on where function information
comes from.

Just a SWAG.  Likely, gfortran reads the newly created
'foo.mod' to get information about the subroutine sbr,
so gfortran simply records the location where it obtains
the information about sbr.  That then means the location
for sbr is set to the line 'use foo'.  Why --coverage
finds the `end subroutine` at line 4 then becomes a
mystery.

Uncompressing the module shows that no location information
is stored in a module.

% cat foo.mod | gunzip
GFORTRAN module version '15' created from d.f90
(() () () () () () () () () () () () () () () () () () () () () () () ()
() () ())
()
()
()
()
()
(2 'foo' 'foo' '' 1 ((MODULE UNKNOWN-INTENT UNKNOWN-PROC UNKNOWN UNKNOWN
0 0) () (UNKNOWN 0 0 0 0 UNKNOWN ()) 0 0 () () 0 () () () 0 0)
3 'sbr' 'foo' '' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC DECL UNKNOWN 0
0 SUBROUTINE IMPLICIT_PURE) () (UNKNOWN 0 0 0 0 UNKNOWN ()) 0 0 () () 0
() () () 0 0)
)
('foo' 0 2 'sbr' 0 3)

So, it seems the strengthened assumption isn't so strong.

  parent reply	other threads:[~2020-11-05 19:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 19:11 [Bug fortran/95847] New: " olebole at debian dot org
2020-06-23 21:07 ` [Bug gcov-profile/95847] " dominiq at lps dot ens.fr
2020-06-24  6:53 ` [Bug gcov-profile/95847] [9/10/11 Regression] " rguenth at gcc dot gnu.org
2020-11-03 16:47 ` johannes.ziegenbalg at mailbox dot org
2020-11-03 16:48 ` johannes.ziegenbalg at mailbox dot org
2020-11-03 18:06 ` marxin at gcc dot gnu.org
2020-11-05 17:08 ` [Bug fortran/95847] " marxin at gcc dot gnu.org
2020-11-05 19:51 ` kargl at gcc dot gnu.org [this message]
2020-11-05 22:29 ` burnus at gcc dot gnu.org
2020-11-10  9:31 ` cvs-commit at gcc dot gnu.org
2020-11-12 13:21 ` burnus at gcc dot gnu.org
2020-11-12 14:42 ` cvs-commit at gcc dot gnu.org
2020-11-12 15:41 ` cvs-commit at gcc dot gnu.org
2020-11-12 15:43 ` burnus 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-95847-4-XrrvLmbOoN@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).