Commit da4f9e3b by Tobias Schlüter Committed by Tobias Schlüter

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
parent 979bf9a1
2004-06-21 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* array.c (gfc_insert_constructor): Avoid redundant call to
mpz_comp. Add 2004 to copyright years.
2004-06-21 Joseph S. Myers <jsm@polyomino.org.uk> 2004-06-21 Joseph S. Myers <jsm@polyomino.org.uk>
* trans.h (stmtblock_t): Change has_scope to unsigned int. * trans.h (stmtblock_t): Change has_scope to unsigned int.
......
/* Array things /* 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 Contributed by Andy Vaught
This file is part of GCC. This file is part of GCC.
...@@ -605,6 +605,7 @@ gfc_insert_constructor (gfc_expr * base, gfc_constructor * c1) ...@@ -605,6 +605,7 @@ gfc_insert_constructor (gfc_expr * base, gfc_constructor * c1)
{ {
gfc_constructor *c, *pre; gfc_constructor *c, *pre;
expr_t type; expr_t type;
int t;
type = base->expr_type; type = base->expr_type;
...@@ -617,12 +618,13 @@ gfc_insert_constructor (gfc_expr * base, gfc_constructor * c1) ...@@ -617,12 +618,13 @@ gfc_insert_constructor (gfc_expr * base, gfc_constructor * c1)
{ {
if (type == EXPR_ARRAY) 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; pre = c;
c = c->next; c = c->next;
} }
else if (mpz_cmp (c->n.offset, c1->n.offset) == 0) else if (t == 0)
{ {
gfc_error ("duplicated initializer"); gfc_error ("duplicated initializer");
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment