aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2010-04-15 21:32:21 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2010-04-15 21:32:21 +0000
commite3e529d14c8be68ad1aff0c95f5fefd2e8b0a9f3 (patch)
treec3a285871dae8a0a6d64f9ea295acf99edeee287
parent58c8f7700a237538681b287d03625ca85a71e651 (diff)
downloadgcc-e3e529d14c8be68ad1aff0c95f5fefd2e8b0a9f3.zip
gcc-e3e529d14c8be68ad1aff0c95f5fefd2e8b0a9f3.tar.gz
gcc-e3e529d14c8be68ad1aff0c95f5fefd2e8b0a9f3.tar.bz2
re PR fortran/30073 (Array out of bounds gives name of RHS array not LHS array)
PR fortran/30073 * trans-array.c (gfc_trans_array_bound_check): Eliminate a redundant block of code. Set name to the variable associated with the descriptor. From-SVN: r158392
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-array.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index fdf4e99..b828104 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-15 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/30073
+ * trans-array.c (gfc_trans_array_bound_check): Eliminate a redundant
+ block of code. Set name to the variable associated with the descriptor.
+
2010-04-15 Jakub Jelinek <jakub@redhat.com>
* trans-decl.c (gfc_build_qualified_array): Clear DECL_IGNORED_P
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 0380049..a880f0e 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -2324,10 +2324,6 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
&& se->loop->ss->loop_chain->expr->symtree)
name = se->loop->ss->loop_chain->expr->symtree->name;
- if (!name && se->loop && se->loop->ss && se->loop->ss->loop_chain
- && se->loop->ss->loop_chain->expr->symtree)
- name = se->loop->ss->loop_chain->expr->symtree->name;
-
if (!name && se->loop && se->loop->ss && se->loop->ss->expr)
{
if (se->loop->ss->expr->expr_type == EXPR_FUNCTION
@@ -2339,6 +2335,9 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
name = "unnamed constant";
}
+ if (descriptor->base.code != COMPONENT_REF)
+ name = IDENTIFIER_POINTER (DECL_NAME (descriptor));
+
/* If upper bound is present, include both bounds in the error message. */
if (check_upper)
{