- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Testing the new version of the Fortran compiler for linux (Intel Fortran Compiler XE for applications running on IA-32, Version 12.0.0.084 Build 20101006), I encountered a catastrophic error with following code:
module tests
implicit none
type :: test
integer :: i
end type
interface test
module procedure new_test
end interface
type, extends (test) :: derived_test
real :: r
end type
interface derived_test
module procedure new_derived_test
end interface
contains
function new_test (i) result (a_test)
integer, intent (in) :: i
type (test) :: a_test
a_test % i = i
end function
function new_derived_test (i, r) result (a_test)
integer, intent (in) :: i
real, intent (in) :: r
type (derived_test) :: a_test
a_test % i = i
a_test % r = r
end function
end module
program testing
use tests
implicit none
class (test), allocatable :: a_test
allocate (a_test, source=test(1))
end program
output of compiler run:
ifort -g -O0 -c -o "src/error.o" "../src/error.f90"
../src/error.f90(38): error #6463: This is not a derived type name. [TEST]
class (test), allocatable :: a_test
-----------^
../src/error.f90(39): error #6404: This name does not have a type, and must have an explicit type. [A_TEST]
allocate (a_test, source=test(1))
--------------^
../src/error.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
compilation aborted for ../src/error.f90 (code 1)
make: *** [src/error.o] Error 1
When I comment out the inherited type derived_test, the program compiles fine.
I hope that this error report is useful.
Greetz
Ben
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(Internal tracking id: DPD200163017)
(Resolution Update on 10/26/2011): This defect is fixed in the Intel Fortran Composer XE 2011 Update 7 (2011.1.1.256 - Linux)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Developer wrote that the root-cause of internal error is because TEST is overloaded as both a type name and as an interface name. While not illegal by itself, it is not an advised programming practice Changing one of these names will get rid of the error(s).
The internal error will be addressed in a future update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not a matter of programming practice. Overriding the default structure constructor is a Fortran 2003 feature (and it's even listed in the New and Changed Features in the IFC XE 2011 Release Notes).
If the example provided by the OP is a good representation of the actual code, the easiest solution is to just get rid of the interface blocks (since they do exactly the same as the default structure constructors).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Beg your pardon for the oversight. I relayed this back to the developer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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