diff mbox series

[fortran,committed] Fix PR 57792

Message ID 71e0119c-3b48-2532-e794-4903e027ab80@netcologne.de
State New
Headers show
Series [fortran,committed] Fix PR 57792 | expand

Commit Message

Thomas Koenig Jan. 13, 2019, 3 p.m. UTC
Hell world,

as part of the contiguous improvement process in gfortran, I have
committed the patch below as obvious.  gfortran now does not pack/unpack
if a function result is contiguous.

Regards

	Thomas


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/57792
	* gfortran.dg/internal_pack_18.f90: New test.
diff mbox series

Patch

Index: trans-array.c
===================================================================
--- trans-array.c	(Revision 267903)
+++ trans-array.c	(Arbeitskopie)
@@ -7894,7 +7894,9 @@  gfc_conv_array_parameter (gfc_se * se, gfc_expr *
 	{
 	  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;
 	}
     }