aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2011-01-31 19:11:32 +0100
committerJanus Weil <janus@gcc.gnu.org>2011-01-31 19:11:32 +0100
commitb6c77bcb57974ccbb49f5651f9ba0e443b864d1d (patch)
treeec55bdf179264755e2534d13a90560ef97a954d6 /gcc/fortran
parent0425d6f563d8b76eb4fcf2bf3ebb64cee85f6eca (diff)
downloadgcc-b6c77bcb57974ccbb49f5651f9ba0e443b864d1d.zip
gcc-b6c77bcb57974ccbb49f5651f9ba0e443b864d1d.tar.gz
gcc-b6c77bcb57974ccbb49f5651f9ba0e443b864d1d.tar.bz2
re PR fortran/47463 ([OOP] ICE in gfc_add_component_ref)
2011-01-31 Janus Weil <janus@gcc.gnu.org> PR fortran/47463 * resolve.c (resolve_typebound_subroutine): Bug fix for the case of an argument of a typebound assignment being a component. 2011-01-31 Janus Weil <janus@gcc.gnu.org> PR fortran/47463 * gfortran.dg/typebound_assignment_1.f03: New. From-SVN: r169443
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/resolve.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index f787a97..e146d76 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-31 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47463
+ * resolve.c (resolve_typebound_subroutine): Bug fix for the case of
+ an argument of a typebound assignment being a component.
+
2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 20be0d1..2a0fc49 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -5877,14 +5877,12 @@ resolve_typebound_subroutine (gfc_code *code)
/* Deal with typebound operators for CLASS objects. */
expr = code->expr1->value.compcall.base_object;
- if (expr && expr->symtree->n.sym->ts.type == BT_CLASS
- && code->expr1->value.compcall.name)
+ if (expr && expr->ts.type == BT_CLASS && code->expr1->value.compcall.name)
{
/* Since the typebound operators are generic, we have to ensure
that any delays in resolution are corrected and that the vtab
is present. */
- ts = expr->symtree->n.sym->ts;
- declared = ts.u.derived;
+ declared = expr->ts.u.derived;
c = gfc_find_component (declared, "_vptr", true, true);
if (c->ts.u.derived == NULL)
c->ts.u.derived = gfc_find_derived_vtab (declared);
@@ -5895,6 +5893,7 @@ resolve_typebound_subroutine (gfc_code *code)
/* Use the generic name if it is there. */
name = name ? name : code->expr1->value.function.esym->name;
code->expr1->symtree = expr->symtree;
+ code->expr1->ref = gfc_copy_ref (expr->ref);
expr->symtree->n.sym->ts.u.derived = declared;
gfc_add_vptr_component (code->expr1);
gfc_add_component_ref (code->expr1, name);