Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28446 Discussions

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

IanH
Honored Contributor II
157 Views

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
Kevin_D_Intel
Employee
157 Views

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

(Internal tracking id: DPD200416672)

0 Kudos
jimdempseyatthecove
Honored Contributor III
157 Views

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
Reply