public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/46328] New: ICE with class in parentheses
@ 2010-11-06  9:30 tkoenig at gcc dot gnu.org
  2010-11-06 12:02 ` [Bug fortran/46328] [OOP] type-bound operator call with non-trivial polymorphic operand janus at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2010-11-06  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE with class in parentheses
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org


Reported by Damian Rouson in

http://gcc.gnu.org/ml/fortran/2010-11/msg00100.html

module field_module
  implicit none
  type ,abstract :: field
  contains
    procedure(field_op_real) ,deferred :: multiply_real
    generic :: operator(*) => multiply_real
  end type
  abstract interface
    function field_op_real(lhs,rhs)
      import :: field
      class(field) ,intent(in)  :: lhs
      real ,intent(in) :: rhs
      class(field) ,allocatable :: field_op_real
    end function
  end interface
end module

program main
  use field_module
  implicit none
  class(field) ,pointer :: u
  u = (u)*2.
end program

gets a segementation fault:

program received signal SIGSEGV, Segmentation fault.
0x00000000004b1b5c in gfc_add_component_ref (e=0x14589a0, name=0xd4bf9d
"$vptr")
    at ../../trunk/gcc/fortran/class.c:61
61        gfc_symbol *derived = e->symtree->n.sym->ts.u.derived;

because the symtree is not set:

(gdb) p e->symtree
$3 = (gfc_symtree *) 0x0
(gdb) p *e
$2 = {expr_type = EXPR_FUNCTION, ts = {type = BT_CLASS, kind = 0, u = {derived
= 0x1454c50,
      cl = 0x1454c50, pad = 21318736}, interface = 0x0, is_c_interop = 0,
is_iso_c = 0,
    f90_type = BT_CLASS}, rank = 0, shape = 0x0, symtree = 0x0, ref = 0x0,
where = {
    nextc = 0x14449a8, lb = 0x1444970}, is_boz = 0, is_snan = 0, error = 0,
user_operator = 0,
  mold = 0, representation = {length = 0, string = 0x0}, value = {logical =
21310080,
    iokind = 21310080, integer = {{_mp_alloc = 21310080, _mp_size = 0, _mp_d =
0x7ffff7fc40b0}},
    real = {{_mpfr_prec = 21310080, _mpfr_sign = -134463312, _mpfr_exp = 0,
_mpfr_d = 0x1455160}},
    complex = {{re = {{_mpfr_prec = 21310080, _mpfr_sign = -134463312,
_mpfr_exp = 0,
            _mpfr_d = 0x1455160}}, im = {{_mpfr_prec = 1, _mpfr_sign = 0,
_mpfr_exp = 0,
            _mpfr_d = 0x0}}}}, op = {op = 21310080, uop = 0x7ffff7fc40b0, op1 =
0x0,
      op2 = 0x1455160}, function = {actual = 0x1452a80, name = 0x7ffff7fc40b0
"field_op_real",
      isym = 0x0, esym = 0x1455160}, compcall = {actual = 0x1452a80,
      name = 0x7ffff7fc40b0 "field_op_real", base_object = 0x0, tbp =
0x1455160, ignore_pass = 1,
      assign = 0}, character = {length = 21310080, string = 0x7ffff7fc40b0},


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

end of thread, other threads:[~2012-01-09 23:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-06  9:30 [Bug fortran/46328] New: ICE with class in parentheses tkoenig at gcc dot gnu.org
2010-11-06 12:02 ` [Bug fortran/46328] [OOP] type-bound operator call with non-trivial polymorphic operand janus at gcc dot gnu.org
2011-08-10  4:46 ` damian at rouson dot net
2011-10-30 11:39 ` janus at gcc dot gnu.org
2011-10-31  2:07 ` damian at rouson dot net
2011-10-31 21:04 ` janus at gcc dot gnu.org
2011-10-31 21:52 ` janus at gcc dot gnu.org
2012-01-02 12:50 ` pault at gcc dot gnu.org
2012-01-02 13:02 ` pault at gcc dot gnu.org
2012-01-02 17:02 ` damian at rouson dot net
2012-01-06 16:29 ` burnus at gcc dot gnu.org
2012-01-06 18:07 ` burnus at gcc dot gnu.org
2012-01-09 23:24 ` burnus at gcc dot gnu.org
2012-01-09 23:28 ` 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).