- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe I finally found a nasty compiler bug. Starting with compiler version intel/2017.5.239 up to the most recent avaiable for me intel/2019.0.117, there is a problem with pointing to a component of an allocated derived type. Opposing to the expectation using the pointer modifies always the first component of type instead of the one that it is pointing to. The following minimal reproducer compiled with -O0 returns: F F In the example it is only output, however, it works also wrong for modifying, even with the type components have different POD types. The intel compiler 2016 and earlier shows the expected behavoir. PROGRAM main IMPLICIT NONE TYPE t_traj LOGICAL :: a = .FALSE. LOGICAL :: b = .TRUE. END TYPE t_traj INTEGER, PARAMETER :: noPart = 3 TYPE(t_traj), TARGET, ALLOCATABLE :: sps(:) LOGICAL, POINTER :: p_point(:) ALLOCATE( sps(noPart) ) p_point(1:noPart-1) => sps(1:noPart-1)%b WRITE(*,*) p_point DEALLOCATE( sps ) END PROGRAM main
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This indeed looks like a compiler bug. Please submit it through the Online Support Center.

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