Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

What on earth is a basic block

awa5114
Beginner
509 Views

In the ifort documentation for code coverage, light yellow stands for 'Partially Covered Code'.

Its description runs as follows:

Indicates that more than one basic block was generated for the code at this position. Some of the blocks were covered and some were not. You can override the default color with the -pcolor tool option

What on earth and in the seven heavens is a "basic block"? This could be anything to the uninformed reader. Could be a variable declaration, a whole module, a program.

What is this mysterious entity? Does it have anything to do with this? https://www.obliquity.com/computer/fortran/common.html

 

 

0 Kudos
3 Replies
Arjen_Markus
Honored Contributor I
509 Views

In the context of code coverage a basic block is a fragment of code that will be executed without any interruption.

For instance:

do i =1,10
    read( 20, * ) value(i)
    write( 30, * ) i, value(i)
enddo

The two lines inside the do-loop form a basic block as there is no (visible) means to leave the fragment. If you were to insert a "err = label" statement that would change, as then there is a way of jumping out of the fragment.

0 Kudos
awa5114
Beginner
509 Views

Allright, so if I find a line that is light yellow in my coverage report, what does that actually mean?

0 Kudos
Arjen_Markus
Honored Contributor I
509 Views

My guess - but I immediately acknowledge that I am not an expert in this area - is that the compiler generated multiple instances of the code in question in order to optimise it. This may mean things like: generate one version of a routine with optional arguments in which the argument is not present and one in which it is. Not knowing your code I can only make such guesses.

0 Kudos
Reply