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

Use of !DEC$ATTRIBUTES FORCEINLINE

andrew_4619
Honored Contributor II
540 Views

I read round the help files which do not say very much and had a some (hopefully) quick question.

1] Is the sample below valid usage of the directive?

2] Having use  FORCEINLINE in a subroutine that is called from multiple locations I expected to see an increase in my .exe size but there is no change. Is my expection wrong?

3] would some  build option cause  FORCEINLINE to be ignored?

4] Any other comments or suggestions, the object was to make hacking/code patching more difficult

subroutine myfunc( istat, kbuf1)
!DEC$ATTRIBUTES FORCEINLINE :: myfunc
use mymod
integer(4) :: istat
integer(1) :: kbuf1(1)

!code
!code
!code

return
end

0 Kudos
3 Replies
Steven_L_Intel1
Employee
540 Views

Are you building with the /Qipo option? If not, then FORCEINLINE would not have an effect if the call was in a different source file.

Please put a space between !DEC$ and ATTRIBUTES.  The compiler will accept leaving the space out, but it is not correct.

0 Kudos
TimP
Honored Contributor III
540 Views

If forceinline takes effect when compiling with a single compile command (as opposed to ipo), it should be reflected in opt-report as well as in asm and object code.

0 Kudos
andrew_4619
Honored Contributor II
540 Views

I am not using  /Qipo option I will investigate that. As for the  !DEC$ it seems  I have been wrong for years,  a bad trait from some example files.... A global edit has fixed that :-)

Thanks for the info Steve /TimP that explains my findings.

0 Kudos
Reply