Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29294 Discussions

ifort11 interface and array literal compilation bugs

acarheden
Beginner
720 Views
I'm trying to get a coworker to standardize on ifort 11 for some features I need, but he's found some bugs that are show-stoppers for some of his code. Below are his examples. Note that gfortran and ifort10 both work fine with both of them. Can anyone help me confirm this as an ifort bug or point me to the appropriate fortran standard that explains why it shouldn't compile

Example 1:

program showthebug
implicit none
real :: a(1)
integer :: ia
a = 1.
ia = 1
call subb( a )
call subb( (/ real(ia) /) )
contains
subroutine subb( arg )
real, dimension(:), intent(in) :: arg
print *, 'size(arg) ', size(arg)
print *, 'maxval(arg) ', maxval(arg)
end subroutine subb
end program showthebug

~/docs/fortran 132: ifort showthebug.f90
showthebug.f90(8): error #5082: Syntax error, found ')' when expecting
one of: (
...
call subba( (/ real(ia) /) )
---------------------------^
compilation aborted for showthebug.f90 (code 1)


Example 2:
module dump_0
implicit none
private
public :: dump
interface dump
module procedure dumpInts
end interface
contains
subroutine dumpInts( array )
integer, dimension(:), intent(in) :: array
integer :: i
do i=1, size(array)
print *, array(i)
enddo
end subroutine dumpInts
end module dump_0
module aModule
use dump_0, only: dump
implicit none
private
public :: a_t, dump
interface dump
module procedure dumpOne
end interface
type a_t
character(len=8) :: NAME
integer, dimension(1) :: values
end type a_t
contains
subroutine dumpOne( a )
type(a_t), intent(in) :: a
call dump( a%values )
end subroutine dumpOne
end module aModule
module bModule
use aModule, only: a_t, dump
implicit none
private
public :: b_t, dump
interface dump
module procedure dumpOne
end interface
type b_t
logical :: guilty
type(a_t) :: a
integer, dimension(1) :: values
end type b_t
contains
subroutine dumpOne( b )
use dump_0, only: dump
type(b_t), intent(in) :: b
call dump( b%values )
call dump(b%a)
end subroutine dumpOne
end module bModule

and on compilation v11 of ifort complains
~/docs/fortran 126: ifort -c dump_0.f90 ; ifort -c aModule.f90 ; ifort
-c bModule.f90
bModule.f90(18): error #8032: Generic procedure reference has two or
more specific procedure with the same type/rank/keyword signature.
[AMODULE^DUMP_0^DUMPINTS]
call dump( b%values )
---------^
compilation aborted for bModule.f90 (code 1)

0 Kudos
3 Replies
Steven_L_Intel1
Employee
720 Views
Known bug. See this Knowledge Base article for a description and workaround.
0 Kudos
acarheden
Beginner
720 Views
Awsome, thanks for the quick response. Any ideas on Example 2? Example 1 he acutally said he could work around, but example two is a bigger problem in our code.

Quoting - acarheden
I'm trying to get a coworker to standardize on ifort 11 for some features I need, but he's found some bugs that are show-stoppers for some of his code. Below are his examples. Note that gfortran and ifort10 both work fine with both of them. Can anyone help me confirm this as an ifort bug or point me to the appropriate fortran standard that explains why it shouldn't compile

Example 1:

program showthebug
implicit none
real :: a(1)
integer :: ia
a = 1.
ia = 1
call subb( a )
call subb( (/ real(ia) /) )
contains
subroutine subb( arg )
real, dimension(:), intent(in) :: arg
print *, 'size(arg) ', size(arg)
print *, 'maxval(arg) ', maxval(arg)
end subroutine subb
end program showthebug

~/docs/fortran 132: ifort showthebug.f90
showthebug.f90(8): error #5082: Syntax error, found ')' when expecting
one of: (
...
call subba( (/ real(ia) /) )
---------------------------^
compilation aborted for showthebug.f90 (code 1)


Example 2:
module dump_0
implicit none
private
public :: dump
interface dump
module procedure dumpInts
end interface
contains
subroutine dumpInts( array )
integer, dimension(:), intent(in) :: array
integer :: i
do i=1, size(array)
print *, array(i)
enddo
end subroutine dumpInts
end module dump_0
module aModule
use dump_0, only: dump
implicit none
private
public :: a_t, dump
interface dump
module procedure dumpOne
end interface
type a_t
character(len=8) :: NAME
integer, dimension(1) :: values
end type a_t
contains
subroutine dumpOne( a )
type(a_t), intent(in) :: a
call dump( a%values )
end subroutine dumpOne
end module aModule
module bModule
use aModule, only: a_t, dump
implicit none
private
public :: b_t, dump
interface dump
module procedure dumpOne
end interface
type b_t
logical :: guilty
type(a_t) :: a
integer, dimension(1) :: values
end type b_t
contains
subroutine dumpOne( b )
use dump_0, only: dump
type(b_t), intent(in) :: b
call dump( b%values )
call dump(b%a)
end subroutine dumpOne
end module bModule

and on compilation v11 of ifort complains
~/docs/fortran 126: ifort -c dump_0.f90 ; ifort -c aModule.f90 ; ifort
-c bModule.f90
bModule.f90(18): error #8032: Generic procedure reference has two or
more specific procedure with the same type/rank/keyword signature.
[AMODULE^DUMP_0^DUMPINTS]
call dump( b%values )
---------^
compilation aborted for bModule.f90 (code 1)


0 Kudos
Steven_L_Intel1
Employee
720 Views
Oops - overlooked that one. I'll get back to you on that.
0 Kudos
Reply