diff options
author | Daniel Franke <franke.daniel@gmail.com> | 2010-05-05 15:35:22 -0400 |
---|---|---|
committer | Daniel Franke <dfranke@gcc.gnu.org> | 2010-05-05 15:35:22 -0400 |
commit | 147a19a945773dcb0532d4d925b7b8b98e94a1fd (patch) | |
tree | 5f6885c830d32fb0bde3d39dcccbf5efb6e6dad6 /gcc | |
parent | 564a129d2270cd6cd14683013483b1471f0d04f1 (diff) | |
download | gcc-147a19a945773dcb0532d4d925b7b8b98e94a1fd.zip gcc-147a19a945773dcb0532d4d925b7b8b98e94a1fd.tar.gz gcc-147a19a945773dcb0532d4d925b7b8b98e94a1fd.tar.bz2 |
resolve.c (traverse_data_list): Rephrase error message for non-constant bounds in data-implied-do.
2010-05-05 Daniel Franke <franke.daniel@gmail.com>
* resolve.c (traverse_data_list): Rephrase error message for
non-constant bounds in data-implied-do.
From-SVN: r159080
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 16 |
2 files changed, 14 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 090a431..5b6b42f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,10 @@ 2010-05-05 Daniel Franke <franke.daniel@gmail.com> + * resolve.c (traverse_data_list): Rephrase error message for + non-constant bounds in data-implied-do. + +2010-05-05 Daniel Franke <franke.daniel@gmail.com> + PR fortran/24978 * gfortran.h: Removed repeat count from constructor, removed all usages. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 2c79863..9852af8 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -11837,6 +11837,7 @@ traverse_data_list (gfc_data_variable *var, locus *where) gfc_try retval = SUCCESS; mpz_init (frame.value); + mpz_init (trip); start = gfc_copy_expr (var->iter.start); end = gfc_copy_expr (var->iter.end); @@ -11845,26 +11846,29 @@ traverse_data_list (gfc_data_variable *var, locus *where) if (gfc_simplify_expr (start, 1) == FAILURE || start->expr_type != EXPR_CONSTANT) { - gfc_error ("iterator start at %L does not simplify", &start->where); + gfc_error ("start of implied-do loop at %L could not be " + "simplified to a constant value", &start->where); retval = FAILURE; goto cleanup; } if (gfc_simplify_expr (end, 1) == FAILURE || end->expr_type != EXPR_CONSTANT) { - gfc_error ("iterator end at %L does not simplify", &end->where); + gfc_error ("end of implied-do loop at %L could not be " + "simplified to a constant value", &start->where); retval = FAILURE; goto cleanup; } if (gfc_simplify_expr (step, 1) == FAILURE || step->expr_type != EXPR_CONSTANT) { - gfc_error ("iterator step at %L does not simplify", &step->where); + gfc_error ("step of implied-do loop at %L could not be " + "simplified to a constant value", &start->where); retval = FAILURE; goto cleanup; } - mpz_init_set (trip, end->value.integer); + mpz_set (trip, end->value.integer); mpz_sub (trip, trip, start->value.integer); mpz_add (trip, trip, step->value.integer); @@ -11880,7 +11884,6 @@ traverse_data_list (gfc_data_variable *var, locus *where) { if (traverse_data_var (var->list, where) == FAILURE) { - mpz_clear (trip); retval = FAILURE; goto cleanup; } @@ -11889,7 +11892,6 @@ traverse_data_list (gfc_data_variable *var, locus *where) if (gfc_simplify_expr (e, 1) == FAILURE) { gfc_free_expr (e); - mpz_clear (trip); retval = FAILURE; goto cleanup; } @@ -11899,9 +11901,9 @@ traverse_data_list (gfc_data_variable *var, locus *where) mpz_sub_ui (trip, trip, 1); } - mpz_clear (trip); cleanup: mpz_clear (frame.value); + mpz_clear (trip); gfc_free_expr (start); gfc_free_expr (end); |