- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the following code is accepted by NAG but rejected by ifort/ifx:
program p
integer :: i(4)
data (i(modulo(j,5)),j=1,4) /4*1/
print *, i
end
I get:
% ifort ifort-data-implied-do.f90
ifort-data-implied-do.f90(3): error #7829: This expression cannot be evaluated. [MODULO]
data (i(modulo(j,5)),j=1,4) /4*1/
----------^
compilation aborted for ifort-data-implied-do.f90 (code 1)
NAG warns in -f2003 mode:
% nagfor ifort-data-implied-do.f90 -f2003
NAG Fortran Compiler Release 7.1(Hanzomon) Build 7101
Extension(F2008): ifort-data-implied-do.f90, line 3: Function reference in DATA-implied-DO
[NAG Fortran Compiler normal termination, 1 warning]
but stays silent with -f2008 or -f2018 and works as expected.
Note that a trivial implied do works, such as:
data (i(j),j=1,4) /4*1/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I filed a bug report on both ifx and ifort for this, CMPLRLLVM-50916.
@Harald1, I'm curious. Did you run into this issue with an application or do you just like to test the bounds of a compiler? Either way, keep them coming! These improve the Intel compiler for other developers.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try using the intrinsic function MOD.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jimdempseyatthecove wrote:Try using the intrinsic function MOD.
MODULO is also an intrinsic function, subtly different from MOD.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>MODULO is also an intrinsic function, subtly different from MOD.
Yes, but using MOD, might avoid the ICE and attain the desired effect.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I also tried MOD and INT, and all are rejected (so rejects-valid, no ICE).
Which ifort version are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I filed a bug report on both ifx and ifort for this, CMPLRLLVM-50916.
@Harald1, I'm curious. Did you run into this issue with an application or do you just like to test the bounds of a compiler? Either way, keep them coming! These improve the Intel compiler for other developers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Barbara,
I am performing checks on a few things that sometimes touch more recent Fortran features, and for the (usually more reliable) reference I use Intel and NAG.
From time to time there is interesting fallout, which I report here...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page