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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
                 CC|                            |burnus at gcc dot gnu.org
            Summary|[OOP] ICE with -fcheck=all  |[OOP] ICE with
                   |                            |-fcheck=pointer for CLASS
                   |                            |IS

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-06 
07:50:28 UTC ---
The relevant option is the check  -fcheck=pointer (I have thus updated the
summary).

Valgrind shows:

==32004== Invalid read of size 4
==32004==    at 0x53F289: trans_runtime_error_vararg (trans.c:400)
==32004==    by 0x53FD4B: gfc_trans_runtime_check (trans.c:486)
==32004==    by 0x55C2A5: gfc_conv_procedure_call (trans-expr.c:3276)
==32004==    by 0x56A33C: gfc_conv_intrinsic_funcall (trans-intrinsic.c:1844)
==32004==    by 0x56E5B2: gfc_conv_intrinsic_function (trans-intrinsic.c:6156)
==32004==    by 0x55D849: gfc_conv_function_expr (trans-expr.c:3969)


The ICE happens for:
  if (where)
      line = LOCATION_LINE (where->lb->location);

Shorter example:
  module m
    type t
    end type t
  contains
    subroutine sub(a)
      class(t) :: a
      select type (a)
        class is (t)
          print *, 'Hi there'
      end select
    end subroutine
  end

The issue seems to be the EXTENDS_TYPE_OF call which is generated for CLASS IS;
the call seems to have an "expr->where" defined - but not a
where->lb->location.

Reply via email to