public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41706]  New: [OOP] Calling one TBP as an actual argument of another TBP
@ 2009-10-14 13:33 janus at gcc dot gnu dot org
  2009-10-20  4:17 ` [Bug fortran/41706] " pault at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-10-14 13:33 UTC (permalink / raw)
  To: gcc-bugs

Consider the following code:

module m

type :: t
contains
  procedure, nopass :: a
  procedure, nopass :: b
end type

contains

  real function a (x)
    real :: x
    a = 2.*x
  end function

  real function b (x)
    real :: x
    b = 3.*x
  end function

  subroutine s
    class(t),allocatable :: x
    real :: r
    allocate(x)
    r = x%a (1.1)       ! works
    r = x%a ( b(1.2))   ! works
    r = b ( x%a (1.3))  ! works
    r = x%a(x%b(1.4))   ! fails
  end subroutine

end


The line marked with "fails" triggers the following error (with trunk r152720):

end
   1
Internal Error at (1):
free_expr0(): Bad expr type


Backtrace:

Breakpoint 1, free_expr0 (e=0x1bd70e0) at
/home/jweil/gcc45/trunk/gcc/fortran/expr.c:209
209           gfc_internal_error ("free_expr0(): Bad expr type");
(gdb) bt
#0  free_expr0 (e=0x1bd70e0) at /home/jweil/gcc45/trunk/gcc/fortran/expr.c:209
#1  0x00000000004c54ba in gfc_free_expr (e=0x1bd70e0) at
/home/jweil/gcc45/trunk/gcc/fortran/expr.c:236
#2  0x000000000051e205 in resolve_class_compcall (e=0x1bd47f0) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:5237
#3  0x000000000051e6d3 in gfc_resolve_expr (e=0x1bd47f0) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:5391
#4  0x0000000000522405 in resolve_code (code=0x1bd5330, ns=0x1bd1ea0) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:7601
#5  0x000000000052b5fb in resolve_codes (ns=0x1bd1ea0) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:11931
#6  0x000000000052b518 in resolve_codes (ns=0x1bce0d0) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:11921
#7  0x000000000052b6f0 in gfc_resolve (ns=0x1bce0d0) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:11958
#8  0x000000000050dd80 in gfc_parse_file () at
/home/jweil/gcc45/trunk/gcc/fortran/parse.c:4195
#9  0x000000000054aaf4 in gfc_be_parse_file (set_yydebug=0) at
/home/jweil/gcc45/trunk/gcc/fortran/f95-lang.c:239
#10 0x00000000009b492d in compile_file () at
/home/jweil/gcc45/trunk/gcc/toplev.c:1049
#11 0x00000000009b6c19 in do_compile () at
/home/jweil/gcc45/trunk/gcc/toplev.c:2408
#12 0x00000000009b6cda in toplev_main (argc=2, argv=0x7fff1c893c48) at
/home/jweil/gcc45/trunk/gcc/toplev.c:2450
#13 0x00000000005c814f in main (argc=2, argv=0x7fff1c893c48) at
/home/jweil/gcc45/trunk/gcc/main.c:35


-- 
           Summary: [OOP] Calling one TBP as an actual argument of another
                    TBP
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2009-10-21  9:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-14 13:33 [Bug fortran/41706] New: [OOP] Calling one TBP as an actual argument of another TBP janus at gcc dot gnu dot org
2009-10-20  4:17 ` [Bug fortran/41706] " pault at gcc dot gnu dot org
2009-10-20  4:52 ` pault at gcc dot gnu dot org
2009-10-20 11:30 ` janus at gcc dot gnu dot org
2009-10-20 12:19 ` paul dot richard dot thomas at gmail dot com
2009-10-20 12:29 ` janus at gcc dot gnu dot org
2009-10-21  8:57 ` janus at gcc dot gnu dot org
2009-10-21  9:01 ` janus at gcc dot gnu dot 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).