------- Comment #3 from burnus at gcc dot gnu dot org  2010-07-30 07:02 -------
(In reply to comment #2)
> > it prints the following output:
> >  ifc: (  1.0000000    ,  0.0000000    ) (  2.0000000    ,  0.0000000    ) ( 
> > 3.0000000    ,  0.0000000    )
> >  ap
> > Segmentation fault

If one changes the order of PROCEDURE statements, one can also call "add_poly"
recursively. The dump by itself looks OK, but I was puzzled by:

  vtab$polynom.get_degree = get_degree;
  vtab$polynom.add_poly = add_poly;
  vtab$polynom.init_from_coeff = (void (*<T4cc>) (struct class$polynom &
restrict, struct array1_complex(kind=4) & restrict)) init_from_coeff;

Why is there a cast for init_from_coeff?

Thinking about it a bit more: My vague feeling is that the backend_decl for the
module procedure "init_from_coeff" is not used in the assignment but some
external "init_from_coeff" (with the same assembler name) or something like
that. The reason for that could be that the decl is not quite available as the
procedures are marked as PRIVATE. -- It works without the PRIVATE and it works
if one splits the module and the PROGRAM into two separate files.

You could check in (gfc_get_symbol_decl,) gfc_get_extern_function_decl, and
gfc_create_function_decl whether the sym->backend_decl for "init_from_coeff" is
always the same - or whether a new, non-gsym(bol) decl is generated in
gfc_get_extern_function_decl.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44912

Reply via email to