[Bug fortran/45586] [4.6 Regression] ICE non-trivial conversion at assignment
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 7 22:20:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45586
--- Comment #44 from janus at gcc dot gnu.org 2011-02-07 22:15:47 UTC ---
(In reply to comment #42)
> (In reply to comment #40)
>
> There is indeed something fishy here.
> Your change does the right thing in the non-class case I think ; can't tell
> about the class case.
> Janus ?
Sorry for the late answer. I think the patch is ok. It does not affect OOP
anyway. And for non-class types there was a bug apparently. AFAICS one could
simplify 'conv_parent_component_references' in the following way:
Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c (revision 169891)
+++ gcc/fortran/trans-expr.c (working copy)
@@ -538,6 +538,11 @@ conv_parent_component_references (gfc_se * se, gfc
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;
@@ -546,24 +551,12 @@ conv_parent_component_references (gfc_se * se, gfc
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);
- }
+
+ /* 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);
}
/* Return the contents of a variable. Also handles reference/pointer
More information about the Gcc-bugs
mailing list