From d4f37c41082765e46f559511f4abfb3adb7efb20 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 10 Feb 1998 16:41:14 -0800 Subject: [PATCH] com.c (ffecom_ptr_to_expr): Do upper - lower in the native type, so as to properly handle negative indices. * 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 | 5 +++++ gcc/f/com.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/f/ChangeLog.egcs b/gcc/f/ChangeLog.egcs index d0a048fd553f..7ab871286150 100644 --- a/gcc/f/ChangeLog.egcs +++ b/gcc/f/ChangeLog.egcs @@ -1,3 +1,8 @@ +Tue Feb 10 03:13:48 1998 Richard Henderson + + * 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 Fix -fpedantic combined with `F()' invocation, diff --git a/gcc/f/com.c b/gcc/f/com.c index bf77e515082c..a63864a1ad5d 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -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; -- 2.47.2