- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I found a bug in the ifort compiler. The deallocate statements in the code below return with a 173 error:
[fortran]program test_bug implicit none integer, pointer :: irn(:), jcn(:) integer, pointer :: tmp(:) integer :: error allocate(irn(10)) allocate(jcn(10)) tmp => irn(:) irn => jcn(:) jcn => tmp(:) nullify(tmp) deallocate(irn, stat=error) write(*,*)error deallocate(jcn, stat=error) write(*,*)error stop end program test_bug [/fortran]
I found the same issue in ifort V11.0 and V11.1 on the intel64 architecture. Didn't have any chance to test it on ia32. Is this bug known and/or already fixed?
best regards
alfredo
PS
I'm not sure whether this is correct way of reporting bugs but I couldn't find any other way. Is there any "official" mean to report bugs?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
....
deallocate(irn, stat=error,errmsg=error_message)
write(*,*)error,trim(error_message)
....
$ ./ab
173
A pointer passed to DEALLOCATE points to an array that cannot be deallocated
173
A pointer passed to DEALLOCATE points to an array that cannot be deallocated
I guess your point is you would like an option for compile-time error diagnostics? I suppose the section of an allocatable array (even if it copies the entire array) is distinct from the original allocated array and is not deallocatable. I didn't quickly find an expert discussion of your usage.
Evidently, with change to textbook syntax:
tmp => irn
irn => jcn
jcn => tmp
the behavior also changes to textbook style.
If you didn't set up a support account when you installed ifort, you can register your serial number at https://registrationcenter.intel.com and use the account at premier.intel.com to file your bug or feature request.
deallocate(irn, stat=error,errmsg=error_message)
write(*,*)error,trim(error_message)
....
$ ./ab
173
A pointer passed to DEALLOCATE points to an array that cannot be deallocated
173
A pointer passed to DEALLOCATE points to an array that cannot be deallocated
I guess your point is you would like an option for compile-time error diagnostics? I suppose the section of an allocatable array (even if it copies the entire array) is distinct from the original allocated array and is not deallocatable. I didn't quickly find an expert discussion of your usage.
Evidently, with change to textbook syntax:
tmp => irn
irn => jcn
jcn => tmp
the behavior also changes to textbook style.
If you didn't set up a support account when you installed ifort, you can register your serial number at https://registrationcenter.intel.com and use the account at premier.intel.com to file your bug or feature request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim,
I now realize that my code tries to deallocate a section of an array (even if the section corresponds to the whole array). I got fooled by the fact that the same code works with gfortran. I slightly modified the title of the thread and removed the word "bug".
Best regards
alfredo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are the sections of the standard that rule out using an array section as target instead of an array in this context:
Section 7.4.2:
8 R735 pointer-assignment-stmt is data-pointer-object [ (bounds-spec-list) ] => data-target
28 R739 data-target is variable
29 or expr
30 C723 (R739) A variable shall have either the TARGET or POINTER attribute, and shall not be an
31 array section with a vector subscript.
Section 7.4.2:
8 R735 pointer-assignment-stmt is data-pointer-object [ (bounds-spec-list) ] => data-target
28 R739 data-target is variable
29 or expr
30 C723 (R739) A variable shall have either the TARGET or POINTER attribute, and shall not be an
31 array section with a vector subscript.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mecej,
thanks your your very useful explanation.
Regards
alfredo
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