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

Internal compiler error: IFX with matmul

Daniel_Dopico
New Contributor I
558 Views

The following piece of code throws an ICE in my oneAPI 2024.1, compiling with IFX in Release config.

module formulacion_matR_Kalman
	IMPLICIT NONE
CONTAINS
    
    SUBROUTINE evalfj_matR_kalman (Tang,DIM)
    integer::DIM
	REAL(8),DIMENSION(DIM,DIM)::Tang,matRMmatR,matRMmatRp,matRKmatR,matRCmatR,dwk2_dz,dwk2_dzp,dzp_dz,dzs_dz
	REAL(8) dt2
	
    INTENT(OUT) Tang
    
    Tang=dt2*matmul(matRMmatR,dzs_dz)+dt2*(matRKmatR+matmul(matRCmatR+matRMmatRp,dzp_dz)+matmul(matRMmatR,(dwk2_dz+matmul(dwk2_dzp,dzp_dz))))

    END SUBROUTINE evalfj_matR_kalman
end module formulacion_matR_Kalman

 

0 Kudos
1 Solution
Ron_Green
Moderator
460 Views

I see your bug report and took ownership of it.  I posted this note to your bug report:

 

It appears to be a problem with a backend optimization where it is doing inlining of the matmul.

And it's at O2, the default optimization.

 

I found I can work around it by 2 methods

1) use /O3

2) use option /Qopt-matmul

 

I am tracing this back to the specific backend optimization at fault. i suspect inlining but I could be wrong. I should have this isolated in an hour or so and get the bug report done.

View solution in original post

7 Replies
mecej4
Honored Contributor III
520 Views

I ran into no issues producing an OBJ file at the command line using IFX 2024.1.0 with /Ot, /O2 and /Od (just one option of these three at a time).

Because the matrices in the expression are used without prior definition, there is probably not much optimization to do anyway!

0 Kudos
Ron_Green
Moderator
480 Views

On linux using just -c I do see the ICE.  I am digging in deeper and hope to have some response soon.  I will, of course, get a bug report entered once I track this down.

0 Kudos
Daniel_Dopico
New Contributor I
469 Views

Thank you very much, Ron. I already reported a ticket with the issue.

It is Case#: 06229673.

0 Kudos
Ron_Green
Moderator
461 Views

I see your bug report and took ownership of it.  I posted this note to your bug report:

 

It appears to be a problem with a backend optimization where it is doing inlining of the matmul.

And it's at O2, the default optimization.

 

I found I can work around it by 2 methods

1) use /O3

2) use option /Qopt-matmul

 

I am tracing this back to the specific backend optimization at fault. i suspect inlining but I could be wrong. I should have this isolated in an hour or so and get the bug report done.

Daniel_Dopico
New Contributor I
455 Views

Thank you very much, Ron. I can try one of those!

0 Kudos
Ron_Green
Moderator
351 Views

followup for this forum

 

This bug exists in 2024.1.0 and the upcoming 2024.2.0. 

it did not affect 2024.0.x

It is fixed in the new code branch targeting 2025.0.0 which is due out in the fall

/Qopt-matmul avoids the bug in 2024.1.x and 2024.2.x

 

 

0 Kudos
Daniel_Dopico
New Contributor I
337 Views

Thank you very much, Ron, for handling this so fast.

I reported quite a number of bugs in the last years and I am used to wait for months or even years for a fix and I normally get information when the bug is fixed, not before.

0 Kudos
Reply