diff options
author | Michael Matz <matz@suse.de> | 2011-02-12 13:09:03 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-02-12 14:09:03 +0100 |
commit | 0143a7841784901d71210c36456b63e87fd913aa (patch) | |
tree | 1590d28d037a3e3e0d1714f9d41f583b19f8e8b3 /gcc/fortran | |
parent | 5378dda2ddec38f32c2bd9ac3ddd5416a9530245 (diff) | |
download | gcc-0143a7841784901d71210c36456b63e87fd913aa.zip gcc-0143a7841784901d71210c36456b63e87fd913aa.tar.gz gcc-0143a7841784901d71210c36456b63e87fd913aa.tar.bz2 |
re PR fortran/45586 (ICE non-trivial conversion at assignment)
2011-02-12 Michael Matz <matz@suse.de>
Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/45586
* trans-expr.c (conv_parent_component_references): Avoid
unintendent skipping of parent compounds.
Co-Authored-By: Janus Weil <janus@gcc.gnu.org>
Co-Authored-By: Tobias Burnus <burnus@net-b.de>
From-SVN: r170072
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 27 |
2 files changed, 18 insertions, 17 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9980d4d..7749cad 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2011-02-12 Michael Matz <matz@suse.de> + Janus Weil <janus@gcc.gnu.org> + Tobias Burnus <burnus@net-b.de> + + PR fortran/45586 + * trans-expr.c (conv_parent_component_references): Avoid unintendent + skipping of parent compounds. + 2011-02-11 Tobias Burnus <burnus@net-b.de> PR fortran/47550 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index f19c015..b7d7ed9 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -538,6 +538,11 @@ conv_parent_component_references (gfc_se * se, gfc_ref * ref) dt = ref->u.c.sym; c = ref->u.c.component; + /* Return if the component is not in the parent type. */ + for (cmp = dt->components; cmp; cmp = cmp->next) + if (strcmp (c->name, cmp->name) == 0) + return; + /* Build a gfc_ref to recursively call gfc_conv_component_ref. */ parent.type = REF_COMPONENT; parent.next = NULL; @@ -547,23 +552,11 @@ conv_parent_component_references (gfc_se * se, gfc_ref * ref) if (dt->backend_decl == NULL) gfc_get_derived_type (dt); - if (dt->attr.extension && dt->components) - { - if (dt->attr.is_class) - cmp = dt->components; - else - cmp = dt->components->next; - /* Return if the component is not in the parent type. */ - for (; cmp; cmp = cmp->next) - if (strcmp (c->name, cmp->name) == 0) - return; - - /* Otherwise build the reference and call self. */ - gfc_conv_component_ref (se, &parent); - parent.u.c.sym = dt->components->ts.u.derived; - parent.u.c.component = c; - conv_parent_component_references (se, &parent); - } + /* Build the reference and call self. */ + gfc_conv_component_ref (se, &parent); + parent.u.c.sym = dt->components->ts.u.derived; + parent.u.c.component = c; + conv_parent_component_references (se, &parent); } /* Return the contents of a variable. Also handles reference/pointer |