- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I encountered a nasty silent runtime bug with the -check all (or, specifically, the -check shape) option in ifort 19.0.3.
Example:
program test integer, allocatable :: A(:,:) allocate(A(1,2)) A(1,:) = [1,2] A = A([1],:) print *, A end program
Compile: ifort test.f90 -check all
Output: 1 32765
Generally, assignment from a multidimensional allocatable array variable to itself, using vector-subscripts on the RHS in the leading dimension (e.g. permuting rows of a matrix), results in corrupted array elements beyond the first column. No error or warning is given. Disabling automatic reallocation with -nostandard-realloc-lhs cures the problem.
Hopefully this post spares others lengthy debugging sessions.
Best regards,
Ferdinand
PS: Tested on Ubuntu 18.04.3 LTS and Red Hat Enterprise Linux Server release 7.7
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just noted that this problem has been reported before: https://software.intel.com/en-us/forums/intel-fortran-compiler/topic/831548, this didn't come up with my forum search earlier.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page