diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-12-20 11:51:05 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-12-20 11:51:05 +0000 |
commit | 95d27703bc8777efe9cdf2a1d8cac7a08b1f7168 (patch) | |
tree | 2ced2afc4d48ec55f5d67887dcf87f78589301db /gcc/fortran/invoke.texi | |
parent | de89b5748d68b76b06e3beca4a956060afb79a3d (diff) | |
download | gcc-95d27703bc8777efe9cdf2a1d8cac7a08b1f7168.zip gcc-95d27703bc8777efe9cdf2a1d8cac7a08b1f7168.tar.gz gcc-95d27703bc8777efe9cdf2a1d8cac7a08b1f7168.tar.bz2 |
Introduce -finline-arg-packing.
2019-12-20 Thomas Koenig <tkoenig@gcc.gnu.org>
PR middle-end/91512
PR fortran/92738
* invoke.texi: Document -finline-arg-packing.
* lang.opt: Add -finline-arg-packing.
* options.c (gfc_post_options): Handle -finline-arg-packing.
* trans-array.c (gfc_conv_array_parameter): Use
flag_inline_arg_packing instead of checking for optimize and
optimize_size.
2019-12-20 Thomas Koenig <tkoenig@gcc.gnu.org>
PR middle-end/91512
PR fortran/92738
* gfortran.dg/inline_pack_25.f90: New test.
From-SVN: r279639
Diffstat (limited to 'gcc/fortran/invoke.texi')
-rw-r--r-- | gcc/fortran/invoke.texi | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 0bc054f..299fc9f 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -192,8 +192,9 @@ and warnings}. -ffrontend-loop-interchange -ffrontend-optimize @gol -finit-character=@var{n} -finit-integer=@var{n} -finit-local-zero @gol -finit-derived -finit-logical=@var{<true|false>} @gol --finit-real=@var{<zero|inf|-inf|nan|snan>} @gol --finline-matmul-limit=@var{n} -fmax-array-constructor=@var{n} @gol +-finit-real=@var{<zero|inf|-inf|nan|snan>} +-finline-matmul-limit=@var{n} @gol +-finline-arg-packing -fmax-array-constructor=@var{n} @gol -fmax-stack-var-size=@var{n} -fno-align-commons -fno-automatic @gol -fno-protect-parens -fno-underscoring -fsecond-underscore @gol -fpack-derived -frealloc-lhs -frecursive -frepack-arrays @gol @@ -1779,6 +1780,34 @@ compiled with the @option{-fshort-enums} option. It will make GNU Fortran choose the smallest @code{INTEGER} kind a given enumerator set will fit in, and give all its enumerators this kind. +@item -finline-arg-packing +@opindex @code{finline-arg-packing} +When passing an assumed-shape argument of a procedure as actual +argument to an assumed-size or explicit size or as argument to a +procedure that does not have an explicit interface, the argument may +have to be packed, that is put into contiguous memory. An example is +the call to @code{foo} in +@smallexample + subroutine foo(a) + real, dimension(*) :: a + end subroutine foo + subroutine bar(b) + real, dimension(:) :: b + call foo(b) + end subroutine bar +@end smallexample + +When @option{-finline-arg-packing} is in effect, this packing will be +performed by inline code. This allows for more optimization while +increasing code size. + +@option{-finline-arg-packing} is implied by any of the @option{-O} options +except when optimizing for size via @option{-Os}. If the code +contains a very large number of argument that have to be packed, code +size and also compilation time may become excessive. If that is the +case, it may be better to disable this option. Instances of packing +can be found by using by using @option{-Warray-temporaries}. + @item -fexternal-blas @opindex @code{fexternal-blas} This option will make @command{gfortran} generate calls to BLAS functions |