com.c (ffecom_ptr_to_expr): Do upper - lower in the native type, so as to properly...
authorRichard Henderson <rth@cygnus.com>
Wed, 11 Feb 1998 00:44:03 +0000 (16:44 -0800)
committerJeff Law <law@gcc.gnu.org>
Wed, 11 Feb 1998 00:44:03 +0000 (17:44 -0700)
        * com.c (ffecom_ptr_to_expr) [FFEBLD_opARRAYREF]:  Do upper - lower
        in the native type, so as to properly handle negative indices.

From-SVN: r17847

gcc/f/ChangeLog.egcs
gcc/f/com.c

index da2b7ef47c7d1cc88513836f6a700bac3b3d3207..ab70debcd51b3d7a3a317877841f886b0150d447 100644 (file)
@@ -1,3 +1,8 @@
+Wed Feb 11 01:44:48 1998  Richard Henderson  (rth@cygnus.com)
+
+       * com.c (ffecom_ptr_to_expr) [FFEBLD_opARRAYREF]:  Do upper - lower
+       in the native type, so as to properly handle negative indices.
+
 Fri Jan  9 19:09:07 1998  Craig Burley  <burley@gnu.org>
 
        Fix -fpedantic combined with `F()' invocation,
index 49b2f2424a2e33e1dffebe9008a6815fe745f53d..4934134ab1eeda4613840fef9ac37870827553a7 100644 (file)
@@ -13032,9 +13032,11 @@ ffecom_ptr_to_expr (ffebld expr)
                          item,
                          size_binop (MULT_EXPR,
                                      size_in_bytes (TREE_TYPE (array)),
-                                     size_binop (MINUS_EXPR,
-                                                 ffecom_expr (dims[i]),
-                                                 TYPE_MIN_VALUE (TYPE_DOMAIN (array)))));
+                                     convert (sizetype,
+                                              fold (build (MINUS_EXPR,
+                                                    TREE_TYPE (TYPE_MIN_VALUE (TYPE_DOMAIN (array))),
+                                                    ffecom_expr (dims[i]),
+                                                    TYPE_MIN_VALUE (TYPE_DOMAIN (array)))))));
          }
       }
       return item;