- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I didn't report this through Premier Support because the root of this problem is a programming error, but I wanted to present it for Intel's consideration.
Here's a quick module for compiling (don't worry about linking):
SUBROUTINE BADRTNIMPLICIT REAL*8 (A-H,O-Z)COMMON/ A / ASIF (AS(1).EQ.0) WRITE(*,*) 'BAD'RETURNEND
Compiling this,I get "Error: This COMMON scalar or array is invalid in this context. [AS]" This is as expected.
However, I change it so the COMMON block holds a POINTER like so:
SUBROUTINE BADRTNIMPLICIT REAL*8 (A-H,O-Z)POINTER(ASPTR,AS)COMMON/ A / ASPTRIF (AS(1).EQ.0) WRITE(*,*) 'BAD'RETURNEND
and it compiles okay with no error. Honestly, I would have thought I'd get something more like the first error.
Now I adda DLLIMPORT directive for the COMMON block:
SUBROUTINE BADRTNIMPLICIT REAL*8 (A-H,O-Z)
!DEC$ ATTRIBUTES DLLIMPORT :: / A /
POINTER(ASPTR,AS)COMMON/ A / ASPTRIF ( AS(1).EQ.0) WRITE(*,*) 'BAD'RETURNEND
andI get "Severe: **Internal compiler error: internal abort** 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."
If Iadd the DLLIMPORT directive to the original version, I still get the original error. So what's different when it's a POINTER?
-Dan Hoyt, Senior Systems Architect, Technology Service Corp, Colorado Operations
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First of all, Internal Compiler Errors should always be reported. Always. Even when triggered by a coding error. I'd appreciate it if you would do so. Please reference "T77302-CP".
In the second example, the compiler thinks that AS is a function since it is not declared or used in a context that prevents that (as in your first example.)
We have had bugs in the area of DLLIMPORT and pointers and you have found another one. Here's a workaround (though you probably intend to add an array declaration for AS somewhere...
SUBROUTINE BADRTN
IMPLICIT REAL*8 (A-H,O-Z)
!DEC$ ATTRIBUTES DLLIMPORT :: / A /
POINTER(TMP_ASPTR,AS)
INTEGER(INT_PTR_KIND()) ASPTR
COMMON/ A / ASPTR
TMP_ASPTR = ASPTR
IF (AS(1).EQ.0) WRITE(*,*) 'BAD'
RETURN
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Reported, sir. Issue# 431880.
Yes, I did already work around it with a DIMENSION.
FYI, the reason I've structuredmy codein this rather obtuse way (both POINTER and DLLIMPORT)is to provide a means of memory sharing between C++ and Fortran with minimal impact to my legacy Fortran code. C++ owns the memory,I convert all myFortran COMMONs to POINTERs, then initialize the POINTERs at the beginning of my program. Speed impact is negligible, and the existing Fortransource doesn't really change beyond the COMMONs.
-Dan Hoyt

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page