This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41706] New: [OOP] Calling one TBP as an actual argument of another TBP
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Oct 2009 13:33:41 -0000
- Subject: [Bug fortran/41706] New: [OOP] Calling one TBP as an actual argument of another TBP
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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