Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29381 Discussions

Internal Compiler Error (ICE) with ifort 12.0.1

jr_reuter
Beginner
1,093 Views
Ifort 12.0.1 produces an internal compiler error, when doing the following:
ifort -c iso_varying_string.f90
ifort -c variables.f90
variables.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 variables.f90 (code 1)

iso_varying_string is the standard file from: http://www.fortran.com/iso_varying_string.f95
and variables.f90 is the following simple file of roughly 150 lines:


module kinds

implicit none
private

public :: single, double
public :: default

integer, parameter :: single = &
& selected_real_kind (precision(1.), range(1.))
integer, parameter :: double = &
& selected_real_kind (precision(1._single) + 1, range(1._single) + 1)

integer, parameter :: default = double

end module kinds

!!!!!

module diagnostics

use kinds, only: default !NODEP!
use iso_varying_string, string_t => varying_string !NODEP!

implicit none
private

public :: int2string
public :: int2char
public :: real2string
public :: real2char
public :: cmplx2string
public :: cmplx2char

type :: string_list
character(len=1000) :: string
type(string_list), pointer :: next
end type string_list
type :: string_list_pointer
type(string_list), pointer :: first, last
end type string_list_pointer

interface real2string
module procedure real2string_list, real2string_fmt
end interface
interface real2char
module procedure real2char_list, real2char_fmt
end interface

contains

pure function int2fixed (i) result (c)
integer, intent(in) :: i
character(200) :: c
c = ""
write (c, *) i
c = adjustl (c)
end function int2fixed

pure function int2string (i) result (s)
integer, intent(in) :: i
type (string_t) :: s
s = trim (int2fixed (i))
end function int2string

pure function int2char (i) result (c)
integer, intent(in) :: i
character(len (trim (int2fixed (i)))) :: c
c = int2fixed (i)
end function int2char

pure function real2fixed (x, fmt) result (c)
real(default), intent(in) :: x
character(*), intent(in), optional :: fmt
character(200) :: c
c = ""
write (c, *) x
c = adjustl (c)
end function real2fixed

pure function real2fixed_fmt (x, fmt) result (c)
real(default), intent(in) :: x
character(*), intent(in) :: fmt
character(200) :: c
c = ""
write (c, fmt) x
c = adjustl (c)
end function real2fixed_fmt

pure function real2string_list (x) result (s)
real(default), intent(in) :: x
type(string_t) :: s
s = trim (real2fixed (x))
end function real2string_list

pure function real2string_fmt (x, fmt) result (s)
real(default), intent(in) :: x
character(*), intent(in) :: fmt
type(string_t) :: s
s = trim (real2fixed_fmt (x, fmt))
end function real2string_fmt

pure function real2char_list (x) result (c)
real(default), intent(in) :: x
character(len_trim (real2fixed (x))) :: c
c = real2fixed (x)
end function real2char_list

pure function real2char_fmt (x, fmt) result (c)
real(default), intent(in) :: x
character(*), intent(in) :: fmt
character(len_trim (real2fixed_fmt (x, fmt))) :: c
c = real2fixed_fmt (x, fmt)
end function real2char_fmt

pure function cmplx2string (x) result (s)
complex(default), intent(in) :: x
type(string_t) :: s
s = real2string (real (x, default))
if (aimag (x) /= 0) s = s // " + " // real2string (aimag (x)) // " I"
end function cmplx2string

pure function cmplx2char (x) result (c)
complex(default), intent(in) :: x
character(len (char (cmplx2string (x)))) :: c
c = char (cmplx2string (x))
end function cmplx2char

end module diagnostics

!!!!!

module variables

use kinds, only: default !NODEP!
use iso_varying_string, string_t => varying_string !NODEP!
use diagnostics !NODEP!

implicit none
private

type :: var_entry_t
private
complex(default), pointer :: cval => null ()
end type var_entry_t

contains

recursive subroutine var_entry_write (var)
type(var_entry_t), intent(in) :: var
!!! TRIGGERS THE ICE
write (6, *) cmplx2char (var%cval)
end subroutine var_entry_write

end module variables
0 Kudos
4 Replies
Ron_Green
Moderator
1,093 Views
Thanks for sending this in. Varying strings is one problem areas that we're working on.

I'll get a bug report entered. Bug ID is DPD200165433

ron
0 Kudos
Ron_Green
Moderator
1,093 Views
this bug is fixed in Composer XE Update 6
0 Kudos
Klaus_Schittkowski
1,093 Views
... error does still exist, at least in XE 12.1.1.258 (IA-32), SP1, downloadedDecember 19, 2011, Update 7

Klaus Schittkowski
0 Kudos
Ron_Green
Moderator
1,093 Views
Klaus,

Are you sure? I cannot reproduce the error:
./buildit.bash
+ ifort -c -O0 iso_varying_string.f90
+ ifort -c -O0 variables.f90
rwgreen@spd16:~/quad/forums/u80216$ ifort -V
Intel Fortran Compiler XE for applications running on IA-32, Version 12.1.1.256 Build 20111011
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.

Make sure you 'source /opt/intel/composer_xe_2011_sp1.7.256/bin/ifortvars.sh ia32'

and check your .bashrc and other dot files to see if somehow the old compiler is left in LD_LIBRARY_PATH, or PATH

ron
0 Kudos
Reply