- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With the following code, i get an internal compiler error C0000005:
[fortran]module mtest type T1 integer :: i contains procedure, private :: calc_int procedure, private :: calc_real generic :: calc => calc_int, calc_real end type type T2 type(T1) :: my_t1 end type contains integer function calc_int(this, i) class(T1) :: this integer :: i calc_int = this%i + i end function integer function calc_real(this, r) class(T1) :: this real :: r calc_real = this%i + int end function end module mtest program test use mtest type(T2) :: a_t2 a_t2%my_t1%i = 7 print *, a_t2%my_t1%calc(5) end program
[/fortran]This is the command line, showing also the compiler version [plain]C:\TEMP>ifort test.f90 Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.1.1.258 Build 20111011 Copyright (C) 1985-2011 Intel Corporation. All rights reserved. fortcom: Fatal: There has been an internal compiler error (C0000005). compilation aborted for test.f90 (code 1) [/plain]
gfortran 4.8, from trunk mid-may,compiles the code and it executes giving the expected result (12)
This isa very much reduced extract from the real code, where a_t2 is a pointer inside another derived type.
I stumbled upon this when I converted an overloaded procedure "calc" to a generic, typebound procedure.
It may be that my code is non-standard, but I have only these two compilers at hand to test it
Johny
[fortran]module mtest type T1 integer :: i contains procedure, private :: calc_int procedure, private :: calc_real generic :: calc => calc_int, calc_real end type type T2 type(T1) :: my_t1 end type contains integer function calc_int(this, i) class(T1) :: this integer :: i calc_int = this%i + i end function integer function calc_real(this, r) class(T1) :: this real :: r calc_real = this%i + int end function end module mtest program test use mtest type(T2) :: a_t2 a_t2%my_t1%i = 7 print *, a_t2%my_t1%calc(5) end program
[/fortran]This is the command line, showing also the compiler version [plain]C:\TEMP>ifort test.f90 Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.1.1.258 Build 20111011 Copyright (C) 1985-2011 Intel Corporation. All rights reserved. fortcom: Fatal: There has been an internal compiler error (C0000005). compilation aborted for test.f90 (code 1) [/plain]
gfortran 4.8, from trunk mid-may,compiles the code and it executes giving the expected result (12)
This isa very much reduced extract from the real code, where a_t2 is a pointer inside another derived type.
I stumbled upon this when I converted an overloaded procedure "calc" to a generic, typebound procedure.
It may be that my code is non-standard, but I have only these two compilers at hand to test it
Johny
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Johny,
I compiled your program and it worked fine! The answer is 12.
I use the most recent compiler version(package 325). I can not see whether that is an explanation for this behaviour.
Robert
I compiled your program and it worked fine! The answer is 12.
I use the most recent compiler version(package 325). I can not see whether that is an explanation for this behaviour.
Robert
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Johny,
I compiled your program and it worked fine! The answer is 12.
I use the most recent compiler version(package 325). I can not see whether that is an explanation for this behaviour.
Robert
I compiled your program and it worked fine! The answer is 12.
I use the most recent compiler version(package 325). I can not see whether that is an explanation for this behaviour.
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Robert,
thank you for taking the time to test this.
So it seems that it is a bug in the compiler that has been corrected since we installed it.
I see that our installation is "update 7" whereas the current one is "update 10".
I'll see to get the most recent update installed and test my reduced case as well as the full procedure that uncovered the problem
Thanks again for your help
Johny
thank you for taking the time to test this.
So it seems that it is a bug in the compiler that has been corrected since we installed it.
I see that our installation is "update 7" whereas the current one is "update 10".
I'll see to get the most recent update installed and test my reduced case as well as the full procedure that uncovered the problem
Thanks again for your help
Johny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can confirm that with update 10 my test case as well as the code that first triggered the bug do compile now.
Johny
Johny

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page