From: Mikael Morin <mikael.morin@sfr.fr>
To: gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [Patch, fortran] Remove gfc_array_ref::offset field
Date: Fri, 27 Jul 2012 16:34:00 -0000 [thread overview]
Message-ID: <5012BCA1.2090104@sfr.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 125 bytes --]
The offset field is never set; this patch removes it.
Regression tested on x86_64-unknown-linux-gnu. OK for trunk?
Mikael
[-- Attachment #2: remove_offset_2.diff --]
[-- Type: text/x-patch, Size: 1838 bytes --]
2012-07-27 Mikael Morin <mikael@gcc.gnu.org>
* array.c (gfc_copy_array_ref): Don't copy the offset field.
* expr.c (find_array_section): Ignore the offset field.
* trans-expr.c (gfc_find_interface_mapping_to_ref): Don't apply
interface mapping to the offset field.
* gfortran.h (struct gfc_array_ref): Remove the offset field.
diff --git a/array.c b/array.c
index 76bd5c3..f23d0bc 100644
--- a/array.c
+++ b/array.c
@@ -50,8 +50,6 @@ gfc_copy_array_ref (gfc_array_ref *src)
dest->stride[i] = gfc_copy_expr (src->stride[i]);
}
- dest->offset = gfc_copy_expr (src->offset);
-
return dest;
}
diff --git a/expr.c b/expr.c
index cb5e1c6..74f204b 100644
--- a/expr.c
+++ b/expr.c
@@ -1493,10 +1493,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
constructor. */
for (idx = 0; idx < (int) mpz_get_si (nelts); idx++)
{
- if (ref->u.ar.offset)
- mpz_set (ptr, ref->u.ar.offset->value.integer);
- else
- mpz_init_set_ui (ptr, 0);
+ mpz_init_set_ui (ptr, 0);
incr_ctr = true;
for (d = 0; d < rank; d++)
diff --git a/gfortran.h b/gfortran.h
index e1f2e3c..0f96772 100644
--- a/gfortran.h
+++ b/gfortran.h
@@ -1515,8 +1515,6 @@ typedef struct gfc_array_ref
*stride[GFC_MAX_DIMENSIONS];
enum gfc_array_ref_dimen_type dimen_type[GFC_MAX_DIMENSIONS];
-
- struct gfc_expr *offset;
}
gfc_array_ref;
diff --git a/trans-expr.c b/trans-expr.c
index 263605a..2603995 100644
--- a/trans-expr.c
+++ b/trans-expr.c
@@ -2806,7 +2806,6 @@ gfc_apply_interface_mapping_to_ref (gfc_interface_mapping * mapping,
gfc_apply_interface_mapping_to_expr (mapping, ref->u.ar.end[n]);
gfc_apply_interface_mapping_to_expr (mapping, ref->u.ar.stride[n]);
}
- gfc_apply_interface_mapping_to_expr (mapping, ref->u.ar.offset);
break;
case REF_COMPONENT:
next reply other threads:[~2012-07-27 16:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 16:34 Mikael Morin [this message]
2012-07-31 15:44 ` Tobias Burnus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5012BCA1.2090104@sfr.fr \
--to=mikael.morin@sfr.fr \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).