Bug 42945 - Gcov -a fails on Fortan generated object file (infinite loop?)
Summary: Gcov -a fails on Fortan generated object file (infinite loop?)
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.4
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-03 14:55 UTC by Graeme Parkin
Modified: 2014-04-17 15:15 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-06-23 00:00:00


Attachments
Contains all Fortran files which give this gcov -a error (434.40 KB, application/x-zip-compressed)
2010-02-03 15:06 UTC, Graeme Parkin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graeme Parkin 2010-02-03 14:55:14 UTC
On trying to do code coverage on set of Fortran files. After using gfortran-4 -fprofile-arcs -ftest-coverage, running test when you try to run gcov -a on one of the Fortran files never ends (the rest are OK). The particular Fortran file contains complex allocate commands. Can simplify and then it works.

The Fortran file is configure_arrays.f90 the modified one is configure_arrays.modified.
Comment 1 Graeme Parkin 2010-02-03 15:06:07 UTC
Created attachment 19796 [details]
Contains all Fortran files which give this gcov -a error

Note can use compile.sh to run compilation etc. Expects lcov in place but can remove and replace with gcov -a. Only run under cygwin 1.7.1.
Comment 2 Richard Biener 2010-02-03 15:41:38 UTC
-a is very expensive and prone to run into some endless cfg reduction, try
to avoid it.
Comment 3 Graeme Parkin 2010-02-03 15:47:52 UTC
(In reply to comment #2)
> -a is very expensive and prone to run into some endless cfg reduction, try
> to avoid it.
> 
I am actually using lcov (1.9) which uses it automatically (only by looking into lcov discovered it used -a if available). I assume lcov uses it for some analysis purpose. Not sure you can stop it and not sure what it does if I do.
Comment 4 Dominique d'Humieres 2013-06-23 18:13:06 UTC
Is the problem still there? I cannot reproduce it with trunk: 'gcov -abcfu mdl.f90' executes in milliseconds (I don't have lcov).
Comment 5 Dominique d'Humieres 2014-03-23 00:13:29 UTC
No reply since 9 months, inactive since more than 4 years. Closing as WORSFORME.
Comment 6 OTIS 2014-04-17 13:52:55 UTC
Hello,

I'm trying to use lcov with a research code developed in Fortran (F77,F90) but I have a similar problem than Graeme Parkin. 

The code is structured as follow :

./CODE/

 ./CODE/bin 

 ./CODE/src 

 ./CODE/testcases

 ./CODE/tools

After compiling the code (gfortran-4.4.5) with the "-fprofile-arcs" "-ftest-coverage" options, I launch the following command :

"lcov -c -z ." 

Then, I run a test by using the executable located in ./CODE/bin where all the ".gda" and ".gcno" files are well generated. 

The next command is the source of my problems 

"lcov -b . -c -d . -o CODE.info"

More precisely, the problem comes from the following command (launched by lcov) 

"gcov file-problem.gcda -o file -b -c -p -a "

and, more particularly, from the uses of the option '-a'. The ".gcov" file is never generated and, by using "strace", I see that the process is waited (what? I don't know).

Without the option "-a", gcov works well. 

Richard Biener advices to avoid the use of '-a' but lcov uses it automatically.



My work is still in progress to understand the source of this problem but if you have any ideas about it or advices....


Thanks you.
Comment 7 kargls 2014-04-17 15:15:48 UTC
(In reply to OTIS from comment #6)
> 
> gfortran-4.4.5
>

4.4.5 was released almost 4 years.  There have numerous
releases since 4.4.5 came out.  See comment #5.