------- Comment #4 from fxcoudert at gcc dot gnu dot org  2006-06-05 14:23 
-------
And I'm sure the warnings are appropriately fixed by:

Index: resolve.c
===================================================================
--- resolve.c   (revision 114340)
+++ resolve.c   (working copy)
@@ -2130,11 +2130,24 @@
          return FAILURE;
        }

-      if (compare_bound (ar->start[i], as->lower[i]) == CMP_LT)
-       goto bound;
-      if (compare_bound (ar->start[i], as->upper[i]) == CMP_GT)
-       goto bound;
+#define AR_START (ar->start[i] ? ar->start[i] : as->lower[i])
+#define AR_END (ar->end[i] ? ar->end[i] : as->upper[i])

+      if (((compare_bound_int (ar->stride[i], 0) == CMP_GT
+           || ar->stride[i] == NULL)
+          && compare_bound (AR_START, AR_END) != CMP_GT)
+         || (compare_bound_int (ar->stride[i], 0) == CMP_LT
+             && compare_bound (AR_START, AR_END) != CMP_LT))
+       {
+         if (compare_bound (AR_START, as->lower[i]) == CMP_LT)
+           goto bound;
+       if (compare_bound (AR_START, as->upper[i]) == CMP_GT)
+           goto bound;
+
+#undef AR_START
+#undef AR_END
+       }
+
       /* TODO: Possibly, we could warn about end[i] being out-of-bound
although
          it is legal (see 6.2.2.3.1).  */


But I'm working on expanding this checking according to the TODO, i.e.
including checking for the end of the triplet.


-- 


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

Reply via email to