Commit 8ef8fa9a by Thomas Koenig

re PR fortran/57992 (Pointless packing of contiguous arrays for simply…

re PR fortran/57992 (Pointless packing of contiguous arrays for simply contiguous functions results as actual arguments)

2019-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/57992
	* trans-array.c (gfc_conv_array_parameter):  Do not pack/unpack
	functions with contiguous results.

2019-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/59345
	* gfortran.dg/internal_pack_18.f90: New test.

From-SVN: r267905
parent 234c3818
2019-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/57992
* trans-array.c (gfc_conv_array_parameter): Do not pack/unpack
functions with contiguous results.
2019-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/59345
* trans-array.c (gfc_conv_array_parameter): Remove TODO. Do not
pack/unpack results of functions which return an explicit-shaped
......
......@@ -7894,7 +7894,9 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, bool g77,
{
gfc_symbol *result = expr->value.function.esym->result;
if (result->attr.dimension
&& (result->as->type == AS_EXPLICIT || result->attr.allocatable))
&& (result->as->type == AS_EXPLICIT
|| result->attr.allocatable
|| result->attr.contiguous))
no_pack = 1;
}
}
......
2019-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/59345
* gfortran.dg/internal_pack_18.f90: New test.
2019-01-13 H.J. Lu <hongjiu.lu@intel.com>
* gcc.dg/pr51628-20.c: Updated.
......
! { dg-do compile }
! { dg-additional-options "-fdump-tree-original" }
! PR 57992 - this was packed/unpacked unnecessarily.
! Original case by Tobias Burnus.
subroutine test
interface
function f2()
integer, pointer, contiguous :: f2(:)
end function f2
end interface
call bar(f2())
end subroutine test
! { dg-final { scan-tree-dump-not "_gfortran_internal_pack" "original" } }
! { dg-final { scan-tree-dump-not "_gfortran_internal_unpack" "original" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment