From da4f9e3b4db0404582e4328bd33a7977f3e8dccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Schl=C3=BCter?= Date: Mon, 21 Jun 2004 19:16:25 +0200 Subject: array.c (gfc_insert_constructor): Avoid redundant call to mpz_comp. * array.c (gfc_insert_constructor): Avoid redundant call to mpz_comp. Add 2004 to copyright years. From-SVN: r83442 --- gcc/fortran/array.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/array.c') diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index bfe8aaf..a7081d8 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1,5 +1,5 @@ /* Array things - Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. Contributed by Andy Vaught This file is part of GCC. @@ -605,6 +605,7 @@ gfc_insert_constructor (gfc_expr * base, gfc_constructor * c1) { gfc_constructor *c, *pre; expr_t type; + int t; type = base->expr_type; @@ -617,12 +618,13 @@ gfc_insert_constructor (gfc_expr * base, gfc_constructor * c1) { if (type == EXPR_ARRAY) { - if (mpz_cmp (c->n.offset, c1->n.offset) < 0) + t = mpz_cmp (c->n.offset, c1->n.offset); + if (t < 0) { pre = c; c = c->next; } - else if (mpz_cmp (c->n.offset, c1->n.offset) == 0) + else if (t == 0) { gfc_error ("duplicated initializer"); break; -- cgit v1.1