This is the mail archive of the mailing list for the GNU Fortran project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [EXTERNAL] Re: [Patch, F03, RFC] FINAL support in 4.8


Mikael Morin wrote:
Le 25/10/2012 16:16, Tobias Burnus a écrit :

For some reason, that's incompatible with how gfc_conv_variable works.
For "ptr%component" everything is fine. One then has as "ref" the
component ref to "universal":

         case REF_COMPONENT:
           if (ref->u.c.sym->attr.extension)
             conv_parent_component_references (se, ref);
           gfc_conv_component_ref (se, ref);

As ref already is the "universal", the search for c->name "universal" in
dt->components (with "dt = ref->u.c.sym") fails.
It shouldn't, as `ref.u.c.sym` is the parent type (i.e.
`ptr%component`'s type).

I think I found the bug after your remark.



--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -853,7 +853,7 @@ finalize_component (gfc_expr *expr, gfc_symbol *derived, gfc_component
gfc_component *c;

for (c = comp->ts.u.derived->components; c; c = c->next)
- finalize_component (e, c->ts.u.derived, c, stat, code);
+ finalize_component (e, comp->ts.u.derived, c, stat, code);
gfc_free_expr (e);
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1512,3 +1521,3 @@ conv_parent_component_references (gfc_se * se, gfc_ref * ref)

-  /* Return if the component is not in the parent type.  */
+  /* Return if the component is in the parent type.  */
   for (cmp = dt->components; cmp; cmp = cmp->next)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]