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

ICE with ifx -assume norealloc_lhs -check all

JacekDziedzic
Principiante
1.720 Vistas
module mwe

contains

  subroutine fail(a,b)

    implicit none

    integer, intent(out), optional :: a
    integer, intent(out), optional :: b
    
    integer :: args_present

    args_present = sum(merge(1,0,[present(a),present(b)]))

  end subroutine fail

end module mwe

The above trivial module ICEs ifx 2025.1.0 20250317, but only with this command line:

ifx -assume norealloc_lhs -check all mwe.F90

Dropping either of the options makes the compiler behave.

 

 

0 kudos
3 Respuestas
Ron_Green
Moderador
1.661 Vistas

It's the -check shape along with -assume norealloc_lhs combo.  I can see how the compiler could get confused about how to check shape when you say to not create an temp for the LHS in this case.  Easy for us to see that the result of the expression on the LHS is a simple scalar, but it's a merge of an array which is then sum'med.  
I will get a bug report started.  Until there is a fix you can use

-warn all,noshape

to prevent the error.  

 

Thank you for a simple and easy to understand sample. 

Ron_Green
Moderador
1.656 Vistas

bug ID is CMPLRLLVM-68884


JacekDziedzic
Principiante
1.540 Vistas

Thank you for making this into a bug ID and for the suggested workaround. We found that a simple replacement of

sum(merge(1,0,[...]))

with

count([...])

made the compiler behave.

Responder