This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fortran-dev, committed] PACK, patch cleanup
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Mar 2009 03:37:17 +0100
- Subject: [fortran-dev, committed] PACK, patch cleanup
I accidently submitted an outdated version of the PACK-patch to review and
committed it subsequently to the dev-branch. Committed r145023 to clean up
after myself ...
2009-03-24 Daniel Franke <franke.daniel@gmail.com>
* check.c (gfc_check_pack): Added safeguards for empty arrays.
* intrinsic.c (gfc_intrinsic_func_interface): Removed experimental
code from r145011.
Index: check.c
===================================================================
--- check.c (revision 145016)
+++ check.c (working copy)
@@ -2163,10 +2163,10 @@ gfc_check_pack (gfc_expr *array, gfc_exp
have_array_size = gfc_array_size (array, &array_size) == SUCCESS;
have_vector_size = gfc_array_size (vector, &vector_size) == SUCCESS;
- if (have_array_size
+ if (have_vector_size
&& (mask->expr_type == EXPR_ARRAY
|| (mask->expr_type == EXPR_CONSTANT
- && have_vector_size)))
+ && have_array_size)))
{
int mask_true_values = 0;
@@ -2202,8 +2202,10 @@ gfc_check_pack (gfc_expr *array, gfc_exp
}
}
- mpz_clear (array_size);
- mpz_clear (vector_size);
+ if (have_array_size)
+ mpz_clear (array_size);
+ if (have_vector_size)
+ mpz_clear (vector_size);
}
return SUCCESS;
Index: intrinsic.c
===================================================================
--- intrinsic.c (revision 145016)
+++ intrinsic.c (working copy)
@@ -3600,12 +3600,9 @@ gfc_intrinsic_func_interface (gfc_expr *
flag = 0;
for (actual = expr->value.function.actual; actual; actual = actual->next)
- if (actual->expr != NULL) {
- gfc_simplify_expr (actual->expr, 0);
-
+ if (actual->expr != NULL)
flag |= (actual->expr->ts.type != BT_INTEGER
&& actual->expr->ts.type != BT_CHARACTER);
- }
name = expr->symtree->n.sym->name;