Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 討論

Regression for IFORT 2021.7.0 with parameter and constructor

Wolf_W_
新貢獻者 I
1,471 檢視

I stumbled upon a compiler bug. The following code worked with former compilers but crashes during compilation now (ifort 2021.7.0 / oneAPI 2022.3.1).

module M_BAR

  type, public :: T_BAR
      integer, public :: member(3) = [0,0,0]
  end type

  type, public, extends(T_BAR) :: T_BAR_HELPER
  end type

#if 0
!Workaround
  type(T_BAR_HELPER), parameter, public :: OBJ_123_help = T_BAR_HELPER([1,2,3])
  type(T_BAR),        parameter, public :: OBJ_123      = OBJ_123_help%T_BAR
#else
  type(T_BAR),        parameter, public :: OBJ_123      = T_BAR([1,2,3])
#endif

  interface T_BAR
    module procedure constructorExtension
  end interface
contains

  pure function constructorExtension(a,b,c)
    integer, intent(in) :: a,b,c
    type(T_BAR) :: constructorExtension

    constructorExtension%member(:) = [a,b,c]

  end function constructorExtension


end module
!---------------------------------------------

program TESTPROG
use M_BAR

  type(T_BAR) :: BB = OBJ_123
  type(T_BAR) :: CC

  CC = OBJ_123
  write(*,*)CC%member(:)

end program TESTPROG

It seems to be a problem with the constructor interface. It works to without the interface, but that would break a lot of code in my case. The workaround with the dummy-type seems to work so far.

 

Greetings

Wolf

0 積分
1 解決方案
TobiasK
主席
1,096 檢視

Hi,


good news, finally the fix made it into release 2023.1. Please try it on your side.


This issue has been resolved and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Best

Tobias


在原始文章中檢視解決方案

5 回應
FortranFan
榮譽貢獻者 III
1,448 檢視

@Wolf_W_ ,

Take it that an internal compiler error (ICE) in encountered now and that's what you mean by, "The following code worked with former compilers but crashes during compilation .."?

ICEs are pernicious and it may help to state them as much if that's what you face to get added attention.

Ron_Green
主席
1,437 檢視

We have been working on constructors.  I'll take and look.

TobiasK
主席
1,325 檢視

Hi Wolf,


thank you for reporting this to us and for the clear and simple reproducer.

I have escalated the issue internally and will track the status for you.

(CMPLRLLVM-41963)


Best

Tobias



TobiasK
主席
1,191 檢視

Hi Wolf,


happy new year!

We fixed the ICE in our internal builds and it will be part of a future release. I will come back to you as soon it is released.

Thanks again for reporting the issue to us!


Best

Tobias


TobiasK
主席
1,097 檢視

Hi,


good news, finally the fix made it into release 2023.1. Please try it on your side.


This issue has been resolved and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Best

Tobias


回覆