http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48066

--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-03-12 
10:10:46 UTC ---
(In reply to comment #6)
> Of course, the patch does not work as "dest" is not NULL ...
> 
> I wonder whether a patch like the following would be correct.

Probably, although it might be easier just to do

Index: m4/ifunction_logical.m4
===================================================================
--- m4/ifunction_logical.m4     (Revision 170320)
+++ m4/ifunction_logical.m4     (Arbeitskopie)
@@ -49,8 +49,8 @@
   src_kind = GFC_DESCRIPTOR_SIZE (array);

   len = GFC_DESCRIPTOR_EXTENT(array,dim);
-  if (len < 0)
-    len = 0;
+  if (len <= 0)
+    return;

   delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);

Index: m4/ifunction.m4
===================================================================
--- m4/ifunction.m4     (Revision 170320)
+++ m4/ifunction.m4     (Arbeitskopie)
@@ -46,8 +46,9 @@
   rank = GFC_DESCRIPTOR_RANK (array) - 1;

   len = GFC_DESCRIPTOR_EXTENT(array,dim);
-  if (len < 0)
-    len = 0;
+  if (len <= 0)
+    return;
+
   delta = GFC_DESCRIPTOR_STRIDE(array,dim);

   for (n = 0; n < dim; n++)

Reply via email to