------- Comment #6 from pault at gcc dot gnu dot org  2008-12-11 11:21 -------
This cures the ICE and allows correct code within the subroutine.  'span' is
not transferred in the call and so wrong code is produced if the pointer is
subsequently used in the caller.

I can apply it if you like.

Paul

Sorry about the rudimentary diff - the VMware images do not carry much by way
of developer's tools.

trans-decl.c

1012,1030d1011
< 
<       if (sym->attr.subref_array_pointer
<           && DECL_LANG_SPECIFIC (sym->backend_decl) == NULL)
<       gfc_allocate_lang_decl (sym->backend_decl);
< 
<       if (sym->attr.subref_array_pointer
<           && GFC_DECL_SPAN (sym->backend_decl) == NULL)
<       {
<         tree span;
<         GFC_DECL_SUBREF_ARRAY_P (sym->backend_decl) = 1;
<         span = build_decl (VAR_DECL, create_tmp_var_name ("span"),
<                            gfc_array_index_type);
<         gfc_finish_var_decl (span, sym);
<         TREE_STATIC (span) = TREE_STATIC (sym->backend_decl);
<         DECL_ARTIFICIAL (span) = 1;
<         DECL_INITIAL (span) = build_int_cst (gfc_array_index_type, 0);
< 
<         GFC_DECL_SPAN (sym->backend_decl) = span;
<       }


-- 


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

Reply via email to