- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everybody,
I noticed that the Intel Compiler has a problem with computed arguments like:
Call AA(N*5)
....
SUBROUTINE AA(NN)
INTEGER*4 NN
I = NN; ! NN is wrong here
It would work if I use a declared variable
LEN = N*5
CALL AA(LEN)
I suppose there is a compiler or linker parameter to avoid this.
Thank you in advance for any suggestion
Jean-Claude
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel compiler can handle expressions in arguments fine - at least in cases I know about. If you believe you have found a situation where it doesn't, please submit a complete example to Intel Premier Support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's strange Steve because I found the problem in 2 different places. I think I understand the problem. It seems that the type of value generated depends on the type of the variables involved. In my case they are defined as INTEGER*2 and I suppose it generates also a temporary variable of the same type, i.e INTEGER*2 and the subroutine called is expecting an integer*4 thus the value is wrong.
By the way it was working properly on Digital Visual Fortran 6.0a.
I think it's a compiler bug but I'm not sure.
I have summarized the source code of the 2 issues (file attached) I have until now find out. I am afraid that there are other statements like this and we will have to check each call statement.
Best wishes,
Jean-Claude
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I forgot to attach the file. Here is the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That isn't a complete program, but I suspect the problem you're seeing is due to the coding error where L and RBAR are declared INTEGER*2 in the caller but you're passing to an INTEGER*4 argument. Passing the character scalar ILINE to array C is also illegal Fortran, though you may be able to get away with it in some cases.
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