inlined maxval

Paul Keir pkeir@dcs.gla.ac.uk
Wed Oct 28 12:40:00 GMT 2009


Thanks, I see how it works now; I just tried -fdump-tree-original as you
suggested.

I'm calling the fortran functions from C++. I take it there's
no way I can obtain the generated inline expansion for those simpler
versions
of maxval from there. I guess not, but as I use g++, I can imagine an
compiler
intrinsic could trigger g++ to invoke gfortran's inliner somehow?

gfc_array_r8 a;
...
double r = __gfortran_inlined_maxval(&a);



Paul Keir wrote:
> Hi,
>
> There are three versions of maxval in gfortran (maxval, mmaxval, and
> smaxval). I wasn't
> sure when each would be applied so I tested minimal programs
containing
> only a single call
> to maxval using "nm"; as in "nm a.out | grep maxval".
>
> This worked fine, but gave me another question. The simplest call to
> maxval (example below),
> once compiled, gives an empty result using the "nm" method. Am I right
> to think that the
> function call is inlined?
>   
If you look at the output from -fdump-tree-original, you will see the 
intermediate code being generated.  It has no calls to the function.

Jerry



More information about the Fortran mailing list