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

Internal compiler error: IFX with matmul

Daniel_Dopico
新分销商 I
1,496 次查看

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 项奖励
1 解答
Ron_Green
主持人
1,398 次查看

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.

在原帖中查看解决方案

7 回复数
mecej4
名誉分销商 III
1,458 次查看

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 项奖励
Ron_Green
主持人
1,418 次查看

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 项奖励
Daniel_Dopico
新分销商 I
1,407 次查看

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

It is Case#: 06229673.

0 项奖励
Ron_Green
主持人
1,399 次查看

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
新分销商 I
1,393 次查看

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

0 项奖励
Ron_Green
主持人
1,289 次查看

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 项奖励
Daniel_Dopico
新分销商 I
1,275 次查看

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 项奖励
回复