public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53643] New: [OOP] ICE (segfault) with INTENT(OUT) CLASS array
@ 2012-06-12  8:43 burnus at gcc dot gnu.org
  2012-06-12  9:50 ` [Bug fortran/53643] " burnus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-06-12  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53643
           Summary: [OOP] ICE (segfault) with INTENT(OUT) CLASS array
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: fanfarillo.gcc@gmail.com


Found by Alessandro Fanfarillo and me, cf.
http://gcc.gnu.org/ml/fortran/2012-06/msg00070.html

The following program gives an ICE (segfault)

type t
  integer, allocatable :: comp
end type t
contains
  subroutine foo(x)
    class(t), allocatable, intent(out) :: x(:)
  end subroutine
end



Untested draft patch:

--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3453,8 +3453,3 @@ init_intent_out_dt (gfc_symbol * proc_sym,
       {
-       tree decl = build_fold_indirect_ref_loc (input_location,
-                                                f->sym->backend_decl);
-       tmp = CLASS_DATA (f->sym)->backend_decl;
-       tmp = fold_build3_loc (input_location, COMPONENT_REF,
-                              TREE_TYPE (tmp), decl, tmp, NULL_TREE);
-       tmp = build_fold_indirect_ref_loc (input_location, tmp);
+       tmp = gfc_class_data_get (f->sym->backend_decl);
        tmp = gfc_deallocate_alloc_comp (CLASS_DATA (f->sym)->ts.u.derived,


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-13 12:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-12  8:43 [Bug fortran/53643] New: [OOP] ICE (segfault) with INTENT(OUT) CLASS array burnus at gcc dot gnu.org
2012-06-12  9:50 ` [Bug fortran/53643] " burnus at gcc dot gnu.org
2012-06-12 12:33 ` burnus at gcc dot gnu.org
2012-06-13 11:58 ` burnus at gcc dot gnu.org
2012-06-13 12:16 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).