]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/m4/ifunction.m4
libgfortran ChangeLog:
[thirdparty/gcc.git] / libgfortran / m4 / ifunction.m4
index cafe3f4e8f4e2baf1a6f7662f8d997335f0f54f7..caf9dbaab8d58fa71f92f97fca9f50087e20e2f4 100644 (file)
@@ -19,18 +19,21 @@ dnl You should not return or break from the inner loop of the implementation.
 dnl Care should also be taken to avoid using the names defined in iparm.m4
 define(START_ARRAY_FUNCTION,
 `
-extern void name`'rtype_qual`_'atype_code (rtype *, atype *, index_type *);
+extern void name`'rtype_qual`_'atype_code (rtype * const restrict, 
+       atype * const restrict, const index_type * const restrict);
 export_proto(name`'rtype_qual`_'atype_code);
 
 void
-name`'rtype_qual`_'atype_code (rtype *retarray, atype *array, index_type *pdim)
+name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array, 
+       const index_type * const restrict pdim)
 {
   index_type count[GFC_MAX_DIMENSIONS];
   index_type extent[GFC_MAX_DIMENSIONS];
   index_type sstride[GFC_MAX_DIMENSIONS];
   index_type dstride[GFC_MAX_DIMENSIONS];
-  atype_name *base;
-  rtype_name *dest;
+  const atype_name * restrict base;
+  rtype_name * restrict dest;
   index_type rank;
   index_type n;
   index_type len;
@@ -102,7 +105,7 @@ name`'rtype_qual`_'atype_code (rtype *retarray, atype *array, index_type *pdim)
 
   while (base)
     {
-      atype_name *src;
+      const atype_name * restrict src;
       rtype_name result;
       src = base;
       {
@@ -152,22 +155,25 @@ define(FINISH_ARRAY_FUNCTION,
 }')dnl
 define(START_MASKED_ARRAY_FUNCTION,
 `
-extern void `m'name`'rtype_qual`_'atype_code (rtype *, atype *, index_type *,
-                                              gfc_array_l4 *);
+extern void `m'name`'rtype_qual`_'atype_code (rtype * const restrict, 
+       atype * const restrict, const index_type * const restrict,
+       gfc_array_l4 * const restrict);
 export_proto(`m'name`'rtype_qual`_'atype_code);
 
 void
-`m'name`'rtype_qual`_'atype_code (rtype * retarray, atype * array,
-                                 index_type *pdim, gfc_array_l4 * mask)
+`m'name`'rtype_qual`_'atype_code (rtype * const restrict retarray, 
+       atype * const restrict array, 
+       const index_type * const restrict pdim, 
+       gfc_array_l4 * const restrict mask)
 {
   index_type count[GFC_MAX_DIMENSIONS];
   index_type extent[GFC_MAX_DIMENSIONS];
   index_type sstride[GFC_MAX_DIMENSIONS];
   index_type dstride[GFC_MAX_DIMENSIONS];
   index_type mstride[GFC_MAX_DIMENSIONS];
-  rtype_name *dest;
-  atype_name *base;
-  GFC_LOGICAL_4 *mbase;
+  rtype_name * restrict dest;
+  const atype_name * restrict base;
+  const GFC_LOGICAL_4 * restrict mbase;
   int rank;
   int dim;
   index_type n;
@@ -258,8 +264,8 @@ void
 
   while (base)
     {
-      atype_name *src;
-      GFC_LOGICAL_4 *msrc;
+      const atype_name * restrict src;
+      const GFC_LOGICAL_4 * restrict msrc;
       rtype_name result;
       src = base;
       msrc = mbase;