]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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:41:14 +0000 (16:41 -0800)
committerJeff Law <law@gcc.gnu.org>
Wed, 11 Feb 1998 00:41:14 +0000 (17:41 -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: r17845

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

index d0a048fd553ff77cfe29025b6b5e6b35d731f55e..7ab87128615086b52b61d4d9ac5b22061a2b2e67 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 10 03:13: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.
+
 Mon Feb  9 00:49:55 1998  Craig Burley  <burley@gnu.ai.mit.edu>
 
        Fix -fpedantic combined with `F()' invocation,
index bf77e515082c0ea6955d24b29f8895ad503eee35..a63864a1ad5d7f6dd31725bc0c0d818bdd4c4d91 100644 (file)
@@ -13036,9 +13036,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;