Use of !DEC$ATTRIBUTES FORCEINLINE

Use of !DEC$ATTRIBUTES FORCEINLINE

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

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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.

Steve - Intel Developer Support

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.

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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today