From 298ed4ca2295023e07a67569fa7db1c0544458ab Mon Sep 17 00:00:00 2001 From: hjl Date: Wed, 10 Sep 2008 21:07:29 +0000 Subject: 2008-09-10 H.J. Lu * expr.c (find_array_element): Reformat. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140248 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 4 ++++ gcc/fortran/expr.c | 38 ++++++++++++++++++-------------------- 2 files changed, 22 insertions(+), 20 deletions(-) (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index eef75e2bbd7..9e5888f054e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2008-09-10 H.J. Lu + + * expr.c (find_array_element): Reformat. + 2008-09-10 Tobias Burnus PR fortran/37420 diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 6ff6d10c6af..6f5aff8c6c0 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -1036,13 +1036,12 @@ find_array_element (gfc_constructor *cons, gfc_array_ref *ar, } /* Check the bounds. */ if ((ar->as->upper[i] - && ar->as->upper[i]->expr_type == EXPR_CONSTANT - && mpz_cmp (e->value.integer, - ar->as->upper[i]->value.integer) > 0) - || - (ar->as->lower[i]->expr_type == EXPR_CONSTANT - && mpz_cmp (e->value.integer, - ar->as->lower[i]->value.integer) < 0)) + && ar->as->upper[i]->expr_type == EXPR_CONSTANT + && mpz_cmp (e->value.integer, + ar->as->upper[i]->value.integer) > 0) + || (ar->as->lower[i]->expr_type == EXPR_CONSTANT + && mpz_cmp (e->value.integer, + ar->as->lower[i]->value.integer) < 0)) { gfc_error ("Index in dimension %d is out of bounds " "at %L", i + 1, &ar->c_where[i]); @@ -1061,19 +1060,18 @@ find_array_element (gfc_constructor *cons, gfc_array_ref *ar, mpz_mul (span, span, tmp); } - for (nelemen = mpz_get_ui (offset); nelemen > 0; nelemen--) - { - if (cons) - { - if (cons->iterator) - { - cons = NULL; - - goto depart; - } - cons = cons->next; - } - } + for (nelemen = mpz_get_ui (offset); nelemen > 0; nelemen--) + { + if (cons) + { + if (cons->iterator) + { + cons = NULL; + goto depart; + } + cons = cons->next; + } + } depart: mpz_clear (delta); -- cgit v1.2.1