[Bug gcov-profile/53414] New: gcov does not generate 'Lines' record for final block of functions

myron.walker at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri May 18 22:04:00 GMT 2012


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

             Bug #: 53414
           Summary: gcov does not generate 'Lines' record for final block
                    of functions
    Classification: Unclassified
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: gcov-profile
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: myron.walker@gmail.com


GCC does not add a Lines record for the final line of code in functions with a
return with if statements having multiple branches.  Examples

This code has a lines marking the end of the function:

01: int global_value = 0;
02:
03: void graph_simplebranch(int taken)
04: {
05:     if(taken > 0)
06:     {
07:         global_value = global_value + 1;
08:     }
09: }

This code does not get a lines record generated for the block that is the end
of the function.

01: int global_value = 0;
02: 
03: void graph_multiplebranches(int pathSelect)
04: {
05:     if(pathSelect == 0)
06:     {
07:         global_value = global_value + 1;
08:     }
09:     else if(pathSelect == 1)
10:     {
11:         global_value = global_value + 2;
12:     }
13:     else
14:     {
15:         global_value = global_value + 3;
16:     }
17: 
18:     return;
19: }



More information about the Gcc-bugs mailing list