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

ICE with 17 update one and MERGE/PRESENT/C_PTR/BIND(C)/VALUE...

The following causes an ICE with 17 update one.

MODULE m
  IMPLICIT NONE
CONTAINS
  SUBROUTINE ice(arg)
    USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_LOC, C_NULL_PTR
    INTEGER, OPTIONAL :: arg
    
    CALL proc(MERGE(C_NULL_PTR, C_NULL_PTR, PRESENT(arg)))
  END SUBROUTINE ice
  
  SUBROUTINE proc(ptr) BIND(C)
    USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_PTR
    TYPE(C_PTR), VALUE :: ptr
  END SUBROUTINE proc
END MODULE m

 

>ifort /c /check:all /warn:all /standard-semantics "2016-12-17 ice.f90"
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0 Build 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

2016-12-17 ice.f90(11): remark #7712: This variable has not been used.   [PTR]
  SUBROUTINE proc(ptr) BIND(C)
------------------^
2016-12-17 ice.f90(8): catastrophic error: **Internal compiler error: internal abort** Please report this error 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-12-17 ice.f90 (code 1)

 

0 Kudos
2 Replies
Highlighted
Employee

Thank you for the report and

Thank you for the report and nice reproducer. I reproduced it and escalated it to Development.

(Internal tracking id: DPD200416672)

0 Kudos
Highlighted

IanH,

IanH,

You sure know how to find ICEs.

What happens with MERGE(SomeNonNull_C_PTR, C_NULL_PTR, PRESENT(arg))
What happens with MERGE(1111, 2222, PRESENT(arg))

Jim Dempsey

0 Kudos