- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[plain]PROGRAM Test LOGICAL f_test LOGICAL f_test2 CALL Set_Test_Vbls(f_test, f_test2) IF (f_test) & IF (f_test2) & WRITE(*,*) 'Test1 and Test2 set' END PROGRAM Test [/plain]I'm not sure the nesting of IF statements is legal, but I think it should give a friendlier error message if it's not allowed.
ifort -V reports:
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.0 Build 20081105 Package ID: l_cprof_p_11.0.074
Compiling as:
ifort -c -fpp -assume byterecl -traceback -g -check all test.f90
Yields:
(14): catastrophic error: Internal Compiler Error: Unexpected statement
compilation aborted for test.f90 (code 1)
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Internal error, particularly as it still happens with a current release, would always be suitable for a bug report. That said, I don't think it's "legal" or desirable syntax. Why not
IF (f_test .and. f_test2) &
WRITE(*,*) 'Test1 and Test2 set'
I've spent more time in my career than I should have cleaning up these compound conditionals. If you're serious about specifying order of shortcut evaluation, use
if(f_test)then
....
endif
IF (f_test .and. f_test2) &
WRITE(*,*) 'Test1 and Test2 set'
I've spent more time in my career than I should have cleaning up these compound conditionals. If you're serious about specifying order of shortcut evaluation, use
if(f_test)then
....
endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
Internal error, particularly as it still happens with a current release, would always be suitable for a bug report. That said, I don't think it's "legal" or desirable syntax. Why not
IF (f_test .and. f_test2) &
WRITE(*,*) 'Test1 and Test2 set'
I've spent more time in my career than I should have cleaning up these compound conditionals. If you're serious about specifying order of shortcut evaluation, use
if(f_test)then
....
endif
IF (f_test .and. f_test2) &
WRITE(*,*) 'Test1 and Test2 set'
I've spent more time in my career than I should have cleaning up these compound conditionals. If you're serious about specifying order of shortcut evaluation, use
if(f_test)then
....
endif
In the live code that I reduced into the report above, I did the latter. The ICE arose when I added the 'if (f_test)' part to an existing 'if (f_test2)' part as a bugfix for an instance where the f_test2 expression wasn't allocated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Amusing. I can reproduce the error and will report it to the developers. The issue ID is DPD200139149.
You should use IF..THEN for this nesting. For the form of IF you used, the "action-stmt" "shall not be an if-stmt, end-program-stmt,, end-function-stmt or end-subroutine-stmt".
You should use IF..THEN for this nesting. For the form of IF you used, the "action-stmt" "shall not be an if-stmt, end-program-stmt,, end-function-stmt or end-subroutine-stmt".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed for a future release.

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