<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: icx 2023.1.0 wrong optimization in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1477885#M2985</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting in Intel communities.&lt;/P&gt;
&lt;P&gt;Have you noticed any differences between the results obtained from using Intel oneAPI 2022.2.1 and 2023.1.0 versions?&lt;/P&gt;
&lt;P&gt;Could you please provide us with the complete code and also elaborate more on your issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Apr 2023 10:34:02 GMT</pubDate>
    <dc:creator>VaishnaviV_Intel</dc:creator>
    <dc:date>2023-04-18T10:34:02Z</dc:date>
    <item>
      <title>icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1477413#M2982</link>
      <description>&lt;P&gt;Dear support,&lt;/P&gt;
&lt;P&gt;We encountered a problem with icx compiler on Linux and Windows considering optimization&lt;BR /&gt;Setup:&lt;BR /&gt;Intel oneAPI 2023.1.0&lt;BR /&gt;Windows 10 Enterprise&lt;BR /&gt;RHEL 8.7&lt;/P&gt;
&lt;P&gt;Find below a reproducer icx.cxx and its compiler output for Linux and Windows&lt;BR /&gt;func1 is optimized wrong:&lt;BR /&gt;movsd __real@3ddb7cdfd9d7bdbb(%rip), %xmm4&lt;BR /&gt;ucomisd %xmm2, %xmm4&lt;BR /&gt;divsd %xmm2, %xmm3 &amp;lt;---- division by zero if len is zero&lt;BR /&gt;movapd %xmm2, %xmm1&lt;BR /&gt;cmpltsd %xmm4, %xmm1&lt;BR /&gt;andnpd %xmm3, %xmm1&lt;BR /&gt;xorpd %xmm3, %xmm3&lt;BR /&gt;ja .LBB0_2&lt;BR /&gt;unpcklpd %xmm2, %xmm2&lt;BR /&gt;divpd %xmm2, %xmm0&lt;BR /&gt;movapd %xmm0, %xmm3&lt;BR /&gt;.LBB0_2:&lt;BR /&gt;leaq "??_7MSvector@@6B@"(%rip), %rcx&lt;BR /&gt;movq %rcx, (%rax)&lt;BR /&gt;movupd %xmm3, 8(%rax)&lt;BR /&gt;movlpd %xmm1, 24(%rax)&lt;BR /&gt;retq&lt;/P&gt;
&lt;P&gt;func2 is correct:&lt;BR /&gt;movsd __real@3ddb7cdfd9d7bdbb(%rip), %xmm3&lt;BR /&gt;ucomisd %xmm2, %xmm3&lt;BR /&gt;jbe .LBB1_2 &amp;lt;---- correct branch&lt;BR /&gt;xorpd %xmm0, %xmm0&lt;BR /&gt;movupd %xmm0, (%rcx)&lt;BR /&gt;xorpd %xmm0, %xmm0&lt;BR /&gt;movsd %xmm0, 24(%rax)&lt;BR /&gt;retq&lt;BR /&gt;.LBB1_2:&lt;BR /&gt;divsd %xmm2, %xmm0&lt;BR /&gt;unpcklpd %xmm2, %xmm2&lt;BR /&gt;divpd %xmm2, %xmm1 &amp;lt;---- ok never divide by zero&lt;BR /&gt;movupd %xmm1, (%rcx)&lt;BR /&gt;movsd %xmm0, 24(%rax)&lt;BR /&gt;retq&lt;/P&gt;
&lt;P&gt;Intel oneAPI 2022.2.1 does it right:&lt;BR /&gt;&lt;A href="https://godbolt.org/z/YY5Y3TTjW" target="_blank"&gt;https://godbolt.org/z/YY5Y3TTjW&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Frank&lt;/P&gt;
&lt;P&gt;file icx.cxx&lt;BR /&gt;//windows compile options&lt;BR /&gt;//icx -Qstd=c++17 -O3 -Ob2 -S -fp=precise -Qimf-arch-consistency:true -Qfma- icx.cxx&lt;BR /&gt;//linux compile options&lt;BR /&gt;//icx -std=c++17 -O3 -inline-level=2 -fp-model=precise -fimf-arch-consistency=true -no-fma icx.cxx&lt;BR /&gt;#include &amp;lt;cmath&amp;gt;&lt;BR /&gt;class MSvector {&lt;BR /&gt;public:&lt;BR /&gt;double x, y, z;&lt;BR /&gt;MSvector() {}&lt;BR /&gt;virtual ~MSvector() {}&lt;BR /&gt;MSvector(const double fx, const double fy, const double fz) {&lt;BR /&gt;x = fx;&lt;BR /&gt;y = fy;&lt;BR /&gt;z = fz;&lt;BR /&gt;}&lt;BR /&gt;const MSvector &amp;amp;operator/=(const double d) {&lt;BR /&gt;x /= d;&lt;BR /&gt;y /= d;&lt;BR /&gt;z /= d;&lt;BR /&gt;return *this;&lt;BR /&gt;}&lt;BR /&gt;double len() const { return std::sqrt(x * x + y * y + z * z); }&lt;BR /&gt;};&lt;BR /&gt;class MSunit_vector : public MSvector {&lt;BR /&gt;public:&lt;BR /&gt;MSunit_vector() {}&lt;BR /&gt;MSunit_vector(const double fx, const double fy, const double fz)&lt;BR /&gt;: MSvector(fx, fy, fz) {&lt;BR /&gt;const double size = len();&lt;BR /&gt;#define SMALL_VEC_LEN (1.0E-10)&lt;BR /&gt;if (size &amp;lt; SMALL_VEC_LEN)&lt;BR /&gt;*(MSvector *)this = MSvector(0.0, 0.0, 0.0);&lt;BR /&gt;else&lt;BR /&gt;*(MSvector *)this /= size;&lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;inline MSunit_vector normalise(const MSvector &amp;amp;v) {&lt;BR /&gt;return MSunit_vector(v.x, v.y, v.z);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;auto func1(const MSvector &amp;amp;vn) {&lt;BR /&gt;MSvector v = normalise(vn);&lt;BR /&gt;return v;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;auto func2(const MSvector &amp;amp;vn) {&lt;BR /&gt;return normalise(vn);&lt;BR /&gt;}&lt;BR /&gt;//icx -Qstd=c++17 -O3 -Ob2 -S -fp=precise -Qimf-arch-consistency:true -Qfma- icx.cxx&lt;BR /&gt;//windows output&lt;BR /&gt;///////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;.text&lt;BR /&gt;.def @feat.00;&lt;BR /&gt;.scl 3;&lt;BR /&gt;.type 0;&lt;BR /&gt;.endef&lt;BR /&gt;.globl @feat.00&lt;BR /&gt;.set @feat.00, 0&lt;BR /&gt;.file "icx.cxx"&lt;BR /&gt;.def "?func1@@YA?A?&amp;lt;auto&amp;gt;@@AEBVMSvector@@@Z";&lt;BR /&gt;.scl 2;&lt;BR /&gt;.type 32;&lt;BR /&gt;.endef&lt;BR /&gt;.globl __real@3ddb7cdfd9d7bdbb&lt;BR /&gt;.section .rdata,"dr",discard,__real@3ddb7cdfd9d7bdbb&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;__real@3ddb7cdfd9d7bdbb:&lt;BR /&gt;.quad 0x3ddb7cdfd9d7bdbb&lt;BR /&gt;.section .text,"xr",one_only,"?func1@@YA?A?&amp;lt;auto&amp;gt;@@AEBVMSvector@@@Z"&lt;BR /&gt;.globl "?func1@@YA?A?&amp;lt;auto&amp;gt;@@AEBVMSvector@@@Z"&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;"?func1@@YA?A?&amp;lt;auto&amp;gt;@@AEBVMSvector@@@Z":&lt;BR /&gt;movq %rcx, %rax&lt;BR /&gt;movsd 24(%rdx), %xmm3&lt;BR /&gt;movupd 8(%rdx), %xmm0&lt;BR /&gt;movapd %xmm0, %xmm1&lt;BR /&gt;mulpd %xmm0, %xmm1&lt;BR /&gt;movapd %xmm1, %xmm2&lt;BR /&gt;unpckhpd %xmm1, %xmm2&lt;BR /&gt;addsd %xmm1, %xmm2&lt;BR /&gt;movapd %xmm3, %xmm1&lt;BR /&gt;mulsd %xmm3, %xmm1&lt;BR /&gt;addsd %xmm2, %xmm1&lt;BR /&gt;xorps %xmm2, %xmm2&lt;BR /&gt;sqrtsd %xmm1, %xmm2&lt;BR /&gt;movsd __real@3ddb7cdfd9d7bdbb(%rip), %xmm4&lt;BR /&gt;ucomisd %xmm2, %xmm4&lt;BR /&gt;divsd %xmm2, %xmm3&lt;BR /&gt;movapd %xmm2, %xmm1&lt;BR /&gt;cmpltsd %xmm4, %xmm1&lt;BR /&gt;andnpd %xmm3, %xmm1&lt;BR /&gt;xorpd %xmm3, %xmm3&lt;BR /&gt;ja .LBB0_2&lt;BR /&gt;unpcklpd %xmm2, %xmm2&lt;BR /&gt;divpd %xmm2, %xmm0&lt;BR /&gt;movapd %xmm0, %xmm3&lt;BR /&gt;.LBB0_2:&lt;BR /&gt;leaq "??_7MSvector@@6B@"(%rip), %rcx&lt;BR /&gt;movq %rcx, (%rax)&lt;BR /&gt;movupd %xmm3, 8(%rax)&lt;BR /&gt;movlpd %xmm1, 24(%rax)&lt;BR /&gt;retq&lt;/P&gt;
&lt;P&gt;.def "?func2@@YA?A?&amp;lt;auto&amp;gt;@@AEBVMSvector@@@Z";&lt;BR /&gt;.scl 2;&lt;BR /&gt;.type 32;&lt;BR /&gt;.endef&lt;BR /&gt;.section .text,"xr",one_only,"?func2@@YA?A?&amp;lt;auto&amp;gt;@@AEBVMSvector@@@Z"&lt;BR /&gt;.globl "?func2@@YA?A?&amp;lt;auto&amp;gt;@@AEBVMSvector@@@Z"&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;"?func2@@YA?A?&amp;lt;auto&amp;gt;@@AEBVMSvector@@@Z":&lt;BR /&gt;movq %rcx, %rax&lt;BR /&gt;movsd 24(%rdx), %xmm0&lt;BR /&gt;movupd 8(%rdx), %xmm1&lt;BR /&gt;addq $8, %rcx&lt;BR /&gt;leaq "??_7MSunit_vector@@6B@"(%rip), %rdx&lt;BR /&gt;movq %rdx, (%rax)&lt;BR /&gt;movapd %xmm1, %xmm2&lt;BR /&gt;mulpd %xmm1, %xmm2&lt;BR /&gt;movapd %xmm2, %xmm3&lt;BR /&gt;unpckhpd %xmm2, %xmm3&lt;BR /&gt;addsd %xmm2, %xmm3&lt;BR /&gt;movapd %xmm0, %xmm2&lt;BR /&gt;mulsd %xmm0, %xmm2&lt;BR /&gt;addsd %xmm3, %xmm2&lt;BR /&gt;sqrtsd %xmm2, %xmm2&lt;BR /&gt;movsd __real@3ddb7cdfd9d7bdbb(%rip), %xmm3&lt;BR /&gt;ucomisd %xmm2, %xmm3&lt;BR /&gt;jbe .LBB1_2&lt;BR /&gt;xorpd %xmm0, %xmm0&lt;BR /&gt;movupd %xmm0, (%rcx)&lt;BR /&gt;xorpd %xmm0, %xmm0&lt;BR /&gt;movsd %xmm0, 24(%rax)&lt;BR /&gt;retq&lt;BR /&gt;.LBB1_2:&lt;BR /&gt;divsd %xmm2, %xmm0&lt;BR /&gt;unpcklpd %xmm2, %xmm2&lt;BR /&gt;divpd %xmm2, %xmm1&lt;BR /&gt;movupd %xmm1, (%rcx)&lt;BR /&gt;movsd %xmm0, 24(%rax)&lt;BR /&gt;retq&lt;/P&gt;
&lt;P&gt;.def "??_GMSunit_vector@@UEAAPEAXI@Z";&lt;BR /&gt;.scl 2;&lt;BR /&gt;.type 32;&lt;BR /&gt;.endef&lt;BR /&gt;.section .text,"xr",discard,"??_GMSunit_vector@@UEAAPEAXI@Z"&lt;BR /&gt;.globl "??_GMSunit_vector@@UEAAPEAXI@Z"&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;"??_GMSunit_vector@@UEAAPEAXI@Z":&lt;BR /&gt;.seh_proc "??_GMSunit_vector@@UEAAPEAXI@Z"&lt;BR /&gt;pushq %rsi&lt;BR /&gt;.seh_pushreg %rsi&lt;BR /&gt;subq $32, %rsp&lt;BR /&gt;.seh_stackalloc 32&lt;BR /&gt;.seh_endprologue&lt;BR /&gt;movq %rcx, %rsi&lt;BR /&gt;testl %edx, %edx&lt;BR /&gt;je .LBB2_2&lt;BR /&gt;movq %rsi, %rcx&lt;BR /&gt;callq "??3@YAXPEAX@Z"&lt;BR /&gt;.LBB2_2:&lt;BR /&gt;movq %rsi, %rax&lt;BR /&gt;addq $32, %rsp&lt;BR /&gt;popq %rsi&lt;BR /&gt;retq&lt;BR /&gt;.seh_endproc&lt;/P&gt;
&lt;P&gt;.def "??_GMSvector@@UEAAPEAXI@Z";&lt;BR /&gt;.scl 2;&lt;BR /&gt;.type 32;&lt;BR /&gt;.endef&lt;BR /&gt;.section .text,"xr",discard,"??_GMSvector@@UEAAPEAXI@Z"&lt;BR /&gt;.globl "??_GMSvector@@UEAAPEAXI@Z"&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;"??_GMSvector@@UEAAPEAXI@Z":&lt;BR /&gt;.seh_proc "??_GMSvector@@UEAAPEAXI@Z"&lt;BR /&gt;pushq %rsi&lt;BR /&gt;.seh_pushreg %rsi&lt;BR /&gt;subq $32, %rsp&lt;BR /&gt;.seh_stackalloc 32&lt;BR /&gt;.seh_endprologue&lt;BR /&gt;movq %rcx, %rsi&lt;BR /&gt;testl %edx, %edx&lt;BR /&gt;je .LBB3_2&lt;BR /&gt;movq %rsi, %rcx&lt;BR /&gt;callq "??3@YAXPEAX@Z"&lt;BR /&gt;.LBB3_2:&lt;BR /&gt;movq %rsi, %rax&lt;BR /&gt;addq $32, %rsp&lt;BR /&gt;popq %rsi&lt;BR /&gt;retq&lt;BR /&gt;.seh_endproc&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",largest,"??_7MSunit_vector@@6B@"&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;.L__unnamed_1:&lt;BR /&gt;.quad "??_R4MSunit_vector@@6B@"&lt;BR /&gt;.quad "??_GMSunit_vector@@UEAAPEAXI@Z"&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",discard,"??_R4MSunit_vector@@6B@"&lt;BR /&gt;.globl "??_R4MSunit_vector@@6B@"&lt;BR /&gt;.p2align 4, 0x0&lt;BR /&gt;"??_R4MSunit_vector@@6B@":&lt;BR /&gt;.long 1&lt;BR /&gt;.long 0&lt;BR /&gt;.long 0&lt;BR /&gt;.long "??_R0?AVMSunit_vector@@@8"@IMGREL&lt;BR /&gt;.long "??_R3MSunit_vector@@8"@IMGREL&lt;BR /&gt;.long "??_R4MSunit_vector@@6B@"@IMGREL&lt;/P&gt;
&lt;P&gt;.section .data,"dw",discard,"??_R0?AVMSunit_vector@@@8"&lt;BR /&gt;.globl "??_R0?AVMSunit_vector@@@8"&lt;BR /&gt;.p2align 4, 0x0&lt;BR /&gt;"??_R0?AVMSunit_vector@@@8":&lt;BR /&gt;.quad "??_7type_info@@6B@"&lt;BR /&gt;.quad 0&lt;BR /&gt;.asciz ".?AVMSunit_vector@@"&lt;BR /&gt;.zero 4&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",discard,"??_R3MSunit_vector@@8"&lt;BR /&gt;.globl "??_R3MSunit_vector@@8"&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;"??_R3MSunit_vector@@8":&lt;BR /&gt;.long 0&lt;BR /&gt;.long 0&lt;BR /&gt;.long 2&lt;BR /&gt;.long "??_R2MSunit_vector@@8"@IMGREL&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",discard,"??_R2MSunit_vector@@8"&lt;BR /&gt;.globl "??_R2MSunit_vector@@8"&lt;BR /&gt;.p2align 2, 0x0&lt;BR /&gt;"??_R2MSunit_vector@@8":&lt;BR /&gt;.long "??_R1A@?0A@EA@MSunit_vector@@8"@IMGREL&lt;BR /&gt;.long "??_R1A@?0A@EA@MSvector@@8"@IMGREL&lt;BR /&gt;.long 0&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",discard,"??_R1A@?0A@EA@MSunit_vector@@8"&lt;BR /&gt;.globl "??_R1A@?0A@EA@MSunit_vector@@8"&lt;BR /&gt;.p2align 4, 0x0&lt;BR /&gt;"??_R1A@?0A@EA@MSunit_vector@@8":&lt;BR /&gt;.long "??_R0?AVMSunit_vector@@@8"@IMGREL&lt;BR /&gt;.long 1&lt;BR /&gt;.long 0&lt;BR /&gt;.long 4294967295&lt;BR /&gt;.long 0&lt;BR /&gt;.long 64&lt;BR /&gt;.long "??_R3MSunit_vector@@8"@IMGREL&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",discard,"??_R1A@?0A@EA@MSvector@@8"&lt;BR /&gt;.globl "??_R1A@?0A@EA@MSvector@@8"&lt;BR /&gt;.p2align 4, 0x0&lt;BR /&gt;"??_R1A@?0A@EA@MSvector@@8":&lt;BR /&gt;.long "??_R0?AVMSvector@@@8"@IMGREL&lt;BR /&gt;.long 0&lt;BR /&gt;.long 0&lt;BR /&gt;.long 4294967295&lt;BR /&gt;.long 0&lt;BR /&gt;.long 64&lt;BR /&gt;.long "??_R3MSvector@@8"@IMGREL&lt;/P&gt;
&lt;P&gt;.section .data,"dw",discard,"??_R0?AVMSvector@@@8"&lt;BR /&gt;.globl "??_R0?AVMSvector@@@8"&lt;BR /&gt;.p2align 4, 0x0&lt;BR /&gt;"??_R0?AVMSvector@@@8":&lt;BR /&gt;.quad "??_7type_info@@6B@"&lt;BR /&gt;.quad 0&lt;BR /&gt;.asciz ".?AVMSvector@@"&lt;BR /&gt;.zero 1&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",discard,"??_R3MSvector@@8"&lt;BR /&gt;.globl "??_R3MSvector@@8"&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;"??_R3MSvector@@8":&lt;BR /&gt;.long 0&lt;BR /&gt;.long 0&lt;BR /&gt;.long 1&lt;BR /&gt;.long "??_R2MSvector@@8"@IMGREL&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",discard,"??_R2MSvector@@8"&lt;BR /&gt;.globl "??_R2MSvector@@8"&lt;BR /&gt;.p2align 2, 0x0&lt;BR /&gt;"??_R2MSvector@@8":&lt;BR /&gt;.long "??_R1A@?0A@EA@MSvector@@8"@IMGREL&lt;BR /&gt;.long 0&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",largest,"??_7MSvector@@6B@"&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;.L__unnamed_2:&lt;BR /&gt;.quad "??_R4MSvector@@6B@"&lt;BR /&gt;.quad "??_GMSvector@@UEAAPEAXI@Z"&lt;/P&gt;
&lt;P&gt;.section .rdata,"dr",discard,"??_R4MSvector@@6B@"&lt;BR /&gt;.globl "??_R4MSvector@@6B@"&lt;BR /&gt;.p2align 4, 0x0&lt;BR /&gt;"??_R4MSvector@@6B@":&lt;BR /&gt;.long 1&lt;BR /&gt;.long 0&lt;BR /&gt;.long 0&lt;BR /&gt;.long "??_R0?AVMSvector@@@8"@IMGREL&lt;BR /&gt;.long "??_R3MSvector@@8"@IMGREL&lt;BR /&gt;.long "??_R4MSvector@@6B@"@IMGREL&lt;/P&gt;
&lt;P&gt;.section .drectve,"yni"&lt;BR /&gt;.ascii " /DEFAULTLIB:libcpmt.lib"&lt;BR /&gt;.ascii " /DEFAULTLIB:libcmt.lib"&lt;BR /&gt;.ascii " /DEFAULTLIB:libircmt.lib"&lt;BR /&gt;.ascii " /DEFAULTLIB:svml_dispmt.lib"&lt;BR /&gt;.ascii " /DEFAULTLIB:libdecimal.lib"&lt;BR /&gt;.ascii " /DEFAULTLIB:libmmt.lib"&lt;BR /&gt;.ascii " /DEFAULTLIB:oldnames.lib"&lt;BR /&gt;.ascii " /FAILIFMISMATCH:\"_MSC_VER=1900\""&lt;BR /&gt;.ascii " /FAILIFMISMATCH:\"_ITERATOR_DEBUG_LEVEL=0\""&lt;BR /&gt;.ascii " /FAILIFMISMATCH:\"RuntimeLibrary=MT_StaticRelease\""&lt;BR /&gt;.globl "??_7MSunit_vector@@6B@"&lt;BR /&gt;.set "??_7MSunit_vector@@6B@", .L__unnamed_1+8&lt;BR /&gt;.globl "??_7MSvector@@6B@"&lt;BR /&gt;.set "??_7MSvector@@6B@", .L__unnamed_2+8&lt;BR /&gt;.globl _fltused&lt;BR /&gt;///////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;//linux output&lt;BR /&gt;//icx -std=c++17 -O3 -inline-level=2 -fp-model=precise -fimf-arch-consistency=true -no-fma icx.cxx&lt;BR /&gt;///////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;.text&lt;BR /&gt;.file "icx.cxx"&lt;BR /&gt;.section .rodata.cst8,"aM",@progbits,8&lt;BR /&gt;.p2align 3, 0x0 # -- Begin function _Z5func1RK8MSvector&lt;BR /&gt;.LCPI0_0:&lt;BR /&gt;.quad 0x3ddb7cdfd9d7bdbb # 1.0E-10&lt;BR /&gt;.text&lt;BR /&gt;.globl _Z5func1RK8MSvector&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;.type _Z5func1RK8MSvector,@function&lt;BR /&gt;_Z5func1RK8MSvector: # &lt;BR /&gt;.cfi_startproc&lt;BR /&gt;# %bb.0:&lt;BR /&gt;movq %rdi, %rax&lt;BR /&gt;movupd 8(%rsi), %xmm0&lt;BR /&gt;movsd 24(%rsi), %xmm3 # xmm3 = mem[0],zero&lt;BR /&gt;movapd %xmm0, %xmm1&lt;BR /&gt;mulpd %xmm0, %xmm1&lt;BR /&gt;movapd %xmm1, %xmm2&lt;BR /&gt;unpckhpd %xmm1, %xmm2 # xmm2 = xmm2[1],xmm1[1]&lt;BR /&gt;addsd %xmm1, %xmm2&lt;BR /&gt;movapd %xmm3, %xmm1&lt;BR /&gt;mulsd %xmm3, %xmm1&lt;BR /&gt;addsd %xmm2, %xmm1&lt;BR /&gt;xorps %xmm2, %xmm2&lt;BR /&gt;sqrtsd %xmm1, %xmm2&lt;BR /&gt;movsd .LCPI0_0(%rip), %xmm4 # xmm4 = mem[0],zero&lt;BR /&gt;ucomisd %xmm2, %xmm4&lt;BR /&gt;divsd %xmm2, %xmm3&lt;BR /&gt;movapd %xmm2, %xmm1&lt;BR /&gt;cmpltsd %xmm4, %xmm1&lt;BR /&gt;andnpd %xmm3, %xmm1&lt;BR /&gt;xorpd %xmm3, %xmm3&lt;BR /&gt;ja .LBB0_2&lt;BR /&gt;# %bb.1:&lt;BR /&gt;unpcklpd %xmm2, %xmm2 # xmm2 = xmm2[0,0]&lt;BR /&gt;divpd %xmm2, %xmm0&lt;BR /&gt;movapd %xmm0, %xmm3&lt;BR /&gt;.LBB0_2:&lt;BR /&gt;movq $_ZTV8MSvector+16, (%rax)&lt;BR /&gt;movupd %xmm3, 8(%rax)&lt;BR /&gt;movlpd %xmm1, 24(%rax)&lt;BR /&gt;retq&lt;BR /&gt;.Lfunc_end0:&lt;BR /&gt;.size _Z5func1RK8MSvector, .Lfunc_end0-_Z5func1RK8MSvector&lt;BR /&gt;.cfi_endproc&lt;BR /&gt;# -- End function&lt;BR /&gt;.section .text._ZN8MSvectorD2Ev,"axG",@progbits,_ZN8MSvectorD2Ev,comdat&lt;BR /&gt;.weak _ZN8MSvectorD2Ev # -- Begin function _ZN8MSvectorD2Ev&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;.type _ZN8MSvectorD2Ev,@function&lt;BR /&gt;_ZN8MSvectorD2Ev: # &lt;BR /&gt;.cfi_startproc&lt;BR /&gt;# %bb.0:&lt;BR /&gt;retq&lt;BR /&gt;.Lfunc_end1:&lt;BR /&gt;.size _ZN8MSvectorD2Ev, .Lfunc_end1-_ZN8MSvectorD2Ev&lt;BR /&gt;.cfi_endproc&lt;BR /&gt;# -- End function&lt;BR /&gt;.section .rodata.cst8,"aM",@progbits,8&lt;BR /&gt;.p2align 3, 0x0 # -- Begin function _Z5func2RK8MSvector&lt;BR /&gt;.LCPI2_0:&lt;BR /&gt;.quad 0x3ddb7cdfd9d7bdbb # 1.0E-10&lt;BR /&gt;.text&lt;BR /&gt;.globl _Z5func2RK8MSvector&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;.type _Z5func2RK8MSvector,@function&lt;BR /&gt;_Z5func2RK8MSvector: # &lt;BR /&gt;.cfi_startproc&lt;BR /&gt;# %bb.0:&lt;BR /&gt;movq %rdi, %rax&lt;BR /&gt;movupd 8(%rsi), %xmm1&lt;BR /&gt;movsd 24(%rsi), %xmm0 # xmm0 = mem[0],zero&lt;BR /&gt;leaq 8(%rdi), %rcx&lt;BR /&gt;movq $_ZTV13MSunit_vector+16, (%rdi)&lt;BR /&gt;movapd %xmm1, %xmm2&lt;BR /&gt;mulpd %xmm1, %xmm2&lt;BR /&gt;movapd %xmm2, %xmm3&lt;BR /&gt;unpckhpd %xmm2, %xmm3 # xmm3 = xmm3[1],xmm2[1]&lt;BR /&gt;addsd %xmm2, %xmm3&lt;BR /&gt;movapd %xmm0, %xmm2&lt;BR /&gt;mulsd %xmm0, %xmm2&lt;BR /&gt;addsd %xmm3, %xmm2&lt;BR /&gt;sqrtsd %xmm2, %xmm2&lt;BR /&gt;movsd .LCPI2_0(%rip), %xmm3 # xmm3 = mem[0],zero&lt;BR /&gt;ucomisd %xmm2, %xmm3&lt;BR /&gt;jbe .LBB2_2&lt;BR /&gt;# %bb.1:&lt;BR /&gt;xorpd %xmm0, %xmm0&lt;BR /&gt;movupd %xmm0, (%rcx)&lt;BR /&gt;xorpd %xmm0, %xmm0&lt;BR /&gt;movsd %xmm0, 24(%rax)&lt;BR /&gt;retq&lt;BR /&gt;.LBB2_2:&lt;BR /&gt;divsd %xmm2, %xmm0&lt;BR /&gt;unpcklpd %xmm2, %xmm2 # xmm2 = xmm2[0,0]&lt;BR /&gt;divpd %xmm2, %xmm1&lt;BR /&gt;movupd %xmm1, (%rcx)&lt;BR /&gt;movsd %xmm0, 24(%rax)&lt;BR /&gt;retq&lt;BR /&gt;.Lfunc_end2:&lt;BR /&gt;.size _Z5func2RK8MSvector, .Lfunc_end2-_Z5func2RK8MSvector&lt;BR /&gt;.cfi_endproc&lt;BR /&gt;# -- End function&lt;BR /&gt;.section .text._ZN13MSunit_vectorD0Ev,"axG",@progbits,_ZN13MSunit_vectorD0Ev,comdat&lt;BR /&gt;.weak _ZN13MSunit_vectorD0Ev # -- Begin function _ZN13MSunit_vectorD0Ev&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;.type _ZN13MSunit_vectorD0Ev,@function&lt;BR /&gt;_ZN13MSunit_vectorD0Ev: # &lt;BR /&gt;.cfi_startproc&lt;BR /&gt;# %bb.0:&lt;BR /&gt;jmp _ZdlPv # TAILCALL&lt;BR /&gt;.Lfunc_end3:&lt;BR /&gt;.size _ZN13MSunit_vectorD0Ev, .Lfunc_end3-_ZN13MSunit_vectorD0Ev&lt;BR /&gt;.cfi_endproc&lt;BR /&gt;# -- End function&lt;BR /&gt;.section .text._ZN8MSvectorD0Ev,"axG",@progbits,_ZN8MSvectorD0Ev,comdat&lt;BR /&gt;.weak _ZN8MSvectorD0Ev # -- Begin function _ZN8MSvectorD0Ev&lt;BR /&gt;.p2align 4, 0x90&lt;BR /&gt;.type _ZN8MSvectorD0Ev,@function&lt;BR /&gt;_ZN8MSvectorD0Ev: # &lt;BR /&gt;.cfi_startproc&lt;BR /&gt;# %bb.0:&lt;BR /&gt;jmp _ZdlPv # TAILCALL&lt;BR /&gt;.Lfunc_end4:&lt;BR /&gt;.size _ZN8MSvectorD0Ev, .Lfunc_end4-_ZN8MSvectorD0Ev&lt;BR /&gt;.cfi_endproc&lt;BR /&gt;# -- End function&lt;BR /&gt;.type _ZTV13MSunit_vector,@object # &lt;BR /&gt;.section .rodata._ZTV13MSunit_vector,"aG",@progbits,_ZTV13MSunit_vector,comdat&lt;BR /&gt;.weak _ZTV13MSunit_vector&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;_ZTV13MSunit_vector:&lt;BR /&gt;.quad 0&lt;BR /&gt;.quad _ZTI13MSunit_vector&lt;BR /&gt;.quad _ZN8MSvectorD2Ev&lt;BR /&gt;.quad _ZN13MSunit_vectorD0Ev&lt;BR /&gt;.size _ZTV13MSunit_vector, 32&lt;/P&gt;
&lt;P&gt;.type _ZTS13MSunit_vector,@object # &lt;BR /&gt;.section .rodata._ZTS13MSunit_vector,"aG",@progbits,_ZTS13MSunit_vector,comdat&lt;BR /&gt;.weak _ZTS13MSunit_vector&lt;BR /&gt;_ZTS13MSunit_vector:&lt;BR /&gt;.asciz "13MSunit_vector"&lt;BR /&gt;.size _ZTS13MSunit_vector, 16&lt;/P&gt;
&lt;P&gt;.type _ZTS8MSvector,@object # &lt;BR /&gt;.section .rodata._ZTS8MSvector,"aG",@progbits,_ZTS8MSvector,comdat&lt;BR /&gt;.weak _ZTS8MSvector&lt;BR /&gt;_ZTS8MSvector:&lt;BR /&gt;.asciz "8MSvector"&lt;BR /&gt;.size _ZTS8MSvector, 10&lt;/P&gt;
&lt;P&gt;.type _ZTI8MSvector,@object # &lt;BR /&gt;.section .rodata._ZTI8MSvector,"aG",@progbits,_ZTI8MSvector,comdat&lt;BR /&gt;.weak _ZTI8MSvector&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;_ZTI8MSvector:&lt;BR /&gt;.quad _ZTVN10__cxxabiv117__class_type_infoE+16&lt;BR /&gt;.quad _ZTS8MSvector&lt;BR /&gt;.size _ZTI8MSvector, 16&lt;/P&gt;
&lt;P&gt;.type _ZTI13MSunit_vector,@object # &lt;BR /&gt;.section .rodata._ZTI13MSunit_vector,"aG",@progbits,_ZTI13MSunit_vector,comdat&lt;BR /&gt;.weak _ZTI13MSunit_vector&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;_ZTI13MSunit_vector:&lt;BR /&gt;.quad _ZTVN10__cxxabiv120__si_class_type_infoE+16&lt;BR /&gt;.quad _ZTS13MSunit_vector&lt;BR /&gt;.quad _ZTI8MSvector&lt;BR /&gt;.size _ZTI13MSunit_vector, 24&lt;/P&gt;
&lt;P&gt;.type _ZTV8MSvector,@object # &lt;BR /&gt;.section .rodata._ZTV8MSvector,"aG",@progbits,_ZTV8MSvector,comdat&lt;BR /&gt;.weak _ZTV8MSvector&lt;BR /&gt;.p2align 3, 0x0&lt;BR /&gt;_ZTV8MSvector:&lt;BR /&gt;.quad 0&lt;BR /&gt;.quad _ZTI8MSvector&lt;BR /&gt;.quad _ZN8MSvectorD2Ev&lt;BR /&gt;.quad _ZN8MSvectorD0Ev&lt;BR /&gt;.size _ZTV8MSvector, 32&lt;/P&gt;
&lt;P&gt;.ident "Intel(R) oneAPI DPC++/C++ Compiler 2023.1.0 (2023.1.0.20230320)"&lt;BR /&gt;.section ".note.GNU-stack","",@progbits&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 09:52:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1477413#M2982</guid>
      <dc:creator>Frank_R_1</dc:creator>
      <dc:date>2023-04-17T09:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1477885#M2985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting in Intel communities.&lt;/P&gt;
&lt;P&gt;Have you noticed any differences between the results obtained from using Intel oneAPI 2022.2.1 and 2023.1.0 versions?&lt;/P&gt;
&lt;P&gt;Could you please provide us with the complete code and also elaborate more on your issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 10:34:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1477885#M2985</guid>
      <dc:creator>VaishnaviV_Intel</dc:creator>
      <dc:date>2023-04-18T10:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1477939#M2987</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the reproducer ist self explaining and shows the issue.&lt;/P&gt;
&lt;P&gt;The problem in our production code is that floating point exceptions are turned on from a 3rd party package, so that this will lead to a crash.&lt;/P&gt;
&lt;P&gt;And from my understanding the compiled code is wrong. Please correct me if I am wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Frank&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 13:52:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1477939#M2987</guid>
      <dc:creator>Frank_R_1</dc:creator>
      <dc:date>2023-04-18T13:52:32Z</dc:date>
    </item>
    <item>
      <title>Re:icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1479533#M3004</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Can you tell us which third-party package you're using? You mentioned that there were some issues with floating-point exceptions caused by this package. It would be great if you could isolate the problem in a reproducible example so we can investigate it further.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We also tested the sample you provided but didn't encounter any exceptions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Apr 2023 09:07:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1479533#M3004</guid>
      <dc:creator>VaishnaviV_Intel</dc:creator>
      <dc:date>2023-04-24T09:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re:icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1479540#M3005</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a reproducer, please show it to your development team!&lt;/P&gt;
&lt;P&gt;When I try to make it a main program with output the compiler does optimize different and the problem is gone!&lt;/P&gt;
&lt;P&gt;The disassemby output of &lt;SPAN class="sub_section_element_selectors"&gt;func1&lt;/SPAN&gt; shows the problem:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;movsd __real@3ddb7cdfd9d7bdbb(%rip), %xmm4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="sub_section_element_selectors"&gt;if (size &amp;lt; SMALL_VEC_LEN)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;ucomisd %xmm2, %xmm4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;divsd %xmm2, %xmm3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; here division by zero if len is zero (xmm2 is zero) and this is wrong&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;movapd %xmm2, %xmm1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;cmpltsd %xmm4, %xmm1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;andnpd %xmm3, %xmm1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;xorpd %xmm3, %xmm3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;ja .LBB0_2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;unpcklpd %xmm2, %xmm2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;divpd %xmm2, %xmm0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;movapd %xmm0, %xmm3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;.LBB0_2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;leaq "??_7MSvector@@6B@"(%rip), %rcx&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;movq %rcx, (%rax)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;movupd %xmm3, 8(%rax)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;movlpd %xmm1, 24(%rax)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;retq&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sub_section_element_selectors"&gt;func2 does it correct with an additional branch&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sub_section_element_selectors"&gt;movsd __real@3ddb7cdfd9d7bdbb(%rip), %xmm3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (size &amp;lt; SMALL_VEC_LEN)&lt;BR /&gt;ucomisd %xmm2, %xmm3&lt;BR /&gt;jbe .LBB1_2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; correct branch!&lt;BR /&gt;xorpd %xmm0, %xmm0&lt;BR /&gt;movupd %xmm0, (%rcx)&lt;BR /&gt;xorpd %xmm0, %xmm0&lt;BR /&gt;movsd %xmm0, 24(%rax)&lt;BR /&gt;retq&lt;BR /&gt;.LBB1_2:&lt;BR /&gt;divsd %xmm2, %xmm0&lt;BR /&gt;unpcklpd %xmm2, %xmm2&lt;BR /&gt;divpd %xmm2, %xmm1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ok never divide by zero&lt;BR /&gt;movupd %xmm1, (%rcx)&lt;BR /&gt;movsd %xmm0, 24(%rax)&lt;BR /&gt;retq&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Frank&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 09:51:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1479540#M3005</guid>
      <dc:creator>Frank_R_1</dc:creator>
      <dc:date>2023-04-24T09:51:32Z</dc:date>
    </item>
    <item>
      <title>Re:icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1481213#M3011</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We understand your concern and would like to assist you with your problem. However, we would require some additional information to investigate the issue further.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You said that there are no problems with your code and that you are using a third-party package that enables floating point exceptions. We need to know more about this package and how you are using it in your code.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you don't give us this information, we might not be able to help you solve the problem. So, please give us as much information as you can so we can investigate and find a solution.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you for your cooperation.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Apr 2023 10:56:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1481213#M3011</guid>
      <dc:creator>VaishnaviV_Intel</dc:creator>
      <dc:date>2023-04-28T10:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Re:icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1482207#M3017</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 3rd party package has nothing to with this error. We enabled floating point checks for this package (ACIS kernel), therefore the 0/0 floating point exception was thrown!&lt;/P&gt;
&lt;P&gt;This should never happen, because checking for vector length below a threshold (1.0E-10) no division should take place, but it does in the wrong optimized code section.&lt;/P&gt;
&lt;P&gt;Root cause is first and foremost the wrong optimization:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sub_section_element_selectors"&gt;movsd __real@3ddb7cdfd9d7bdbb(%rip), %xmm4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;ucomisd %xmm2, %xmm4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sub_section_element_selectors"&gt;divsd %xmm2, %xmm3&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;xmm2 and xmm3 are both zero if the MSvector is {0.0, 0.0, 0.0}&lt;/P&gt;
&lt;P&gt;There has to be a branch before the division.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Frank&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 08:50:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1482207#M3017</guid>
      <dc:creator>Frank_R_1</dc:creator>
      <dc:date>2023-05-02T08:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1482675#M3041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please confirm whether we are on the right track or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you are having optimization issues from func1() and not func2(). As, func2() is creating a branch before the division operation you are not getting any optimization issue but in func1() first division operation is done and then a branch is being called. In turn, this is leading to optimization issue and that leads to the code crash after enabling the floating point checks at your end.&lt;/P&gt;
&lt;P&gt;Initially, you mentioned that “the problem in the production code was due to floating point exceptions being turned on from a 3rd party package, resulting in a crash”. However, you have now stated that “The 3rd party package has nothing to with this error. We enabled floating point checks for this package (ACIS kernel), therefore the 0/0 floating point exception was thrown!”. This statement contradicts the initial one, causing confusion about the issue.&lt;/P&gt;
&lt;P&gt;Also, we noticed that if we use the same return statements for func1() and func2() as in func2(), we can see that a branch is being created before the division operation. Here are the functions:&lt;/P&gt;
&lt;P&gt;auto func1(const MSvector &amp;amp;vn) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;return normalise(vn);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;auto func2(const MSvector &amp;amp;vn) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;return normalise(vn);&lt;/P&gt;
&lt;P&gt;}&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This seems to be working well in icx 2022.2.1, but not in icx 2023.1.0. Is this correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And also Could you please help fill in the below table?&lt;/P&gt;
&lt;TABLE width="599"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;compiler command&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="87"&gt;
&lt;P&gt;test code&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="142"&gt;
&lt;P&gt;expected execution result&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;actual execution result&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;icpx 2023.1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="87"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="142"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;icpx 2022.2.1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="87"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="142"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 10:26:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1482675#M3041</guid>
      <dc:creator>VaishnaviV_Intel</dc:creator>
      <dc:date>2023-05-05T10:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1483451#M3048</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;This seems to be working well in icx 2022.2.1, but not in icx 2023.1.0. Is this correct?&lt;/P&gt;
&lt;P&gt;YES! Unfortunately &lt;A href="https://godbolt.org/" target="_blank"&gt;https://godbolt.org/&lt;/A&gt; does not have the newest compiler as selection, but you have seen my assembly code!&lt;/P&gt;
&lt;P&gt;fun1 and fun2 with auto work correctly on Windows, on Linux we have still same behavior!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can not fill the table, but the compiler commands are the same. The test code above is extracted from our production code and run correct on debug but not in release mode on both platforms!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the compiler developer team has a lot of tools to check invariants etc. what went wrong in optimization.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Frank&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 13:52:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1483451#M3048</guid>
      <dc:creator>Frank_R_1</dc:creator>
      <dc:date>2023-05-05T13:52:40Z</dc:date>
    </item>
    <item>
      <title>Re:icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1484472#M3059</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;For Community support we would require you to submit a minimum reproduction sample code specific to your issue that provides us the most relevant background information for triage. In case you require privacy, and unable to share the issue / sample with us publicly and If you are a licensed oneAPI product customer and/or member of Intel’s &lt;A href="https://www.intel.com/content/www/us/en/developer/tools/oneapi/training/academic-program.html" rel="noopener noreferrer" target="_blank"&gt;oneAPI Academic Program&lt;/A&gt; please submit a ticket for &lt;A href="https://www.intel.com/content/www/us/en/developer/get-help/priority-support.html" rel="noopener noreferrer" target="_blank"&gt;Priority support&lt;/A&gt; so that your application can be handled with the required data protection and privacy regulations&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp;Regards,&lt;/P&gt;&lt;P&gt;Vankudothu Vaishnavi.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 May 2023 11:36:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1484472#M3059</guid>
      <dc:creator>VaishnaviV_Intel</dc:creator>
      <dc:date>2023-05-09T11:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Re:icx 2023.1.0 wrong optimization</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1484528#M3060</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have done my best to report an issue and give every information a developer of the compiler teams needs. If this is not appreciated in the future I'll just wait for new versions to test and see if the bug is fixed.&lt;/P&gt;
&lt;P&gt;Please close this thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&amp;nbsp; regards&lt;/P&gt;
&lt;P&gt;Frank&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 15:12:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/icx-2023-1-0-wrong-optimization/m-p/1484528#M3060</guid>
      <dc:creator>Frank_R_1</dc:creator>
      <dc:date>2023-05-09T15:12:44Z</dc:date>
    </item>
  </channel>
</rss>

