Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Black Belt

ICE with optional argument, overriden LEN and allocation of deferred length character

T.G.I.F.

MODULE iso_varying_internal_compiler_error
  IMPLICIT NONE
  
  TYPE, PUBLIC :: varying_string
    CHARACTER(:), ALLOCATABLE, PUBLIC :: chars
  END TYPE varying_string
  
  INTERFACE len
    MODULE PROCEDURE len_
  END INTERFACE len
CONTAINS
  ELEMENTAL FUNCTION len_(string) RESULT(length)
    TYPE(varying_string), INTENT(IN) :: string
    INTEGER :: length
    !***************************************************************************
    IF (ALLOCATED(string%chars)) THEN
       length = LEN(string%chars)
    ELSE
       length = 0
    END IF
  END FUNCTION len_
  
  SUBROUTINE get_unit(iomsg)
    CHARACTER(*), INTENT(INOUT), OPTIONAL :: iomsg
    !---------------------------------------------------------------------------
    CHARACTER(:), ALLOCATABLE :: local_iomsg
    !***************************************************************************
    IF (PRESENT(iomsg)) THEN
      ALLOCATE(CHARACTER(LEN(iomsg)) :: local_iomsg)
    ELSE
      ALLOCATE(CHARACTER(1) :: local_iomsg)
    END IF
  END SUBROUTINE get_unit
END MODULE iso_varying_internal_compiler_error

 

>ifort /check:all /warn:all /standard-semantics "2016-03-18 optional_length.f90"
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0 Build 20160204
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

2016-03-18 optional_length.f90(30): catastrophic error: **Internal compiler error: internal abort** Please report this e
rror 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.
compilation aborted for 2016-03-18 optional_length.f90 (code 1)

To the fridge!

0 Kudos
3 Replies
Highlighted

Thanks - we'll check it out.

Thanks - we'll check it out.

Retired 12/31/2016
0 Kudos
Highlighted

Escalated as issue

Escalated as issue DPD200408435. The OPTIONAL aspect doesn't matter, nor do the compile options.

Retired 12/31/2016
0 Kudos
Highlighted

This was fixed in 17.0, but I

This was fixed in 17.0, but I didn't find out about that until now. Probably also one of the later 16.0 updates.

Retired 12/31/2016
0 Kudos