Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29271 ディスカッション

Internal compiler error with MOD statement and /standard-semantics

Jacob_Williams
新規コントリビューター III
571件の閲覧回数
FYI: The following code generates an internal compiler error (latest version of the compiler: 2011 Update 11), but only when I use the /standard-semantics flag.  It is caused when passing an allocatable array as the first argument of the MOD function (see test2 subroutine), while the second argument is a scalar.  The static array version (test1) compiles fine.

[fortran]program test
	
	implicit none

	call test1()
	call test2()
	
contains

!****************************
	subroutine test1		!this one compiles file
!****************************
	implicit none
	integer,dimension(2) :: a, b
	
	a = 4	
	b = mod(a, 2)
	
	write(*,*) b

!****************************
	end subroutine test1
!****************************
		
!****************************
	subroutine test2		!this one causes an internal compiler error
!****************************
	implicit none
	integer,dimension(:),allocatable :: a, b
	
	allocate(a(2))
	allocate(b(2))
	
	a = 4	
	b = mod(a, 2)
	
	write(*,*) b
 
!****************************
	end subroutine test2
!****************************
	
end program test
[/fortran]

0 件の賞賛
3 返答(返信)
Steven_L_Intel1
従業員
571件の閲覧回数
Thanks, we'll take a look.
TimP
名誉コントリビューター III
570件の閲覧回数
It looks like the problem was corrected in the 13.0 beta compiler, so should be OK in the next release.  standard-semantics changes the list-directed formatting; maybe that's what you intended.
Steven_L_Intel1
従業員
570件の閲覧回数
It's the /assume:realloc_lhs part of /standard-semantics that is the problem here.  It isn't specifically the MOD but rather the assignment of the MOD expression to the allocatable array.  Tim is right that this is fixed in the 13.0 compiler, due out in a couple of weeks.  You could add /assume:norealloc_lhs to work around this for now.
返信