- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Note that the use of either of the workarounds removes the error. I believe it is related to ifort's checking that all of the components within the type are initialized.This error occurred on Fedora 14 x64 with ifort12.0.0 20101116 froml_fcompxe_intel64_2011.1.107.
I receive an internal compiler error when compiling the following code:
[fortran]MODULE Error IMPLICIT NONE TYPE, ABSTRACT :: Parent END TYPE Parent TYPE, EXTENDS(Parent) :: Child ! TYPE Child ! workaround 1 INTEGER :: i = 1 END TYPE Child TYPE(Child), PARAMETER :: OBJ = Child() ! TYPE(Child), PARAMETER :: OBJ = Child(1) ! workaround 2 END MODULE Error[/fortran]
The resulting error is:
[plain]/tmp/ifortPvVk9s.i90: 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 error.F90 (code 1)[/plain]
Regards,
Jared Ahern
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code works fine with gfortran (4.5.1)
Have look at the following code
Is C483 inconsitent with C485 when the derived type has only on component and it is default initialized.
Have look at the following code
[fortran] MODULE Error IMPLICIT NONE TYPE,abstract :: Parent END TYPE Parent TYPE, EXTENDS(Parent) :: Child ! TYPE Child ! workaround 1 real :: r INTEGER :: i = 1 END TYPE Child !type(child),parameter :: OBJ = Child(r=5.0) ! Compiles with gfortran but not with ifort !type(child),parameter :: OBJ = Child(r=5.0,i=2) ! Compiles with gfortran does not Compile with ifort type(child),parameter :: obj = child(5.0,2) ! does not compile with gfortran, compiles with ifort but prints a wrong answer ! type(child),parameter :: obj = child(5.0) ! does not compile with ifort and gfortran !------------------------ ! Looks like iforts implimentation is inconsitant with the following rules ! and gfortran doesnot seem to intialize unless keyword is used ! ofcourse the problems seem to be specific to type extension (even if the parent is not abstract) !C483(R457) At most one component-spec shall be provided for a component. !C484(R457) If a component-spec is provided for a component,no component-spec shall be provided ! for any component with which it is inheritance associated. !C485(R457) A component-spec shall be provided for a component unless it has default initialization ! or is inheritance associated with another component for which a component-spec is provided or ! that has default initialization !C486(R458) The keyword=may be omitted from a component-spec only ifthe keyword= has been ! omitted from each preceding component-spec in the constructor. !------------------------- ! TYPE(Child), PARAMETER :: OBJ = Child(1) ! workaround 2 END MODULE Error program Test use Error print*,obj%i,obj%r end program Test [/fortran]
Is C483 inconsitent with C485 when the derived type has only on component and it is default initialized.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will submit a bug report on the internal compiler error.
Thanks,
Xiaoping Duan
Intel Customer support
Thanks,
Xiaoping Duan
Intel Customer support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! Another note - I found that workaround 2 needs explicit type constructors if any derived types are included in the child type (e.g. "TYPE(Child),PARAMETER::OBJ=Child(1,SomeType(4.5))"). That syntax is not really a surprise though.

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