Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
838 Discussions

Unexpected runtime issue when migrating from Intel C++ Compiler 2025.0.1.28 to 2025.3.0.326

Nilesh_Shinde
Beginner
85 Views

Hello,


I am working on an application that was previously compiled with Intel C++ Compiler 2025.0.1.28. The application includes the following function, which is intended to return 1 if the input string is empty and 0 otherwise. With version 2025.0.1.28, the function behaved as expected.

    int ParserCheckZeroLengthString(char* pStr)

    {
        // check if this is a zero-length string
        if (NULL== pStr || pStr[0]=='\0')
        {
                return 1;
        }
        return 0;
    }

After upgrading to Intel C++ Compiler 2025.3.0.326, the build completes successfully, but at runtime the function incorrectly returns 0 instead of 1 when the string is empty.

We are suspecting this issue may be related to compiler optimisations.

To address this, we attempted to disable or reduce optimisation using the following CMake flags, but they had no effect: Function continued to return 0 for empty parameter string.

////Disable optimisation

-DCMAKE_CXX_FLAGS_RELEASE="/Od /DNDEBUG"
-DCMAKE_C_FLAGS_RELEASE="/Od  /DNDEBUG"

and 
////Reduce optimisation level
-DCMAKE_CXX_FLAGS_RELEASE="/O2 /Ob2 /DNDEBUG"
-DCMAKE_C_FLAGS_RELEASE="/O2  /Ob2/DNDEBUG"

Question:
How can we compile the existing code base with Intel C++ Compiler 2025.3.0.326 while preserving the same runtime behaviour as with version 2025.0.1.28?

0 Kudos
1 Reply
Nilesh_Shinde
Beginner
79 Views

Adding printf("returning 1"); just before 'return 1;' statement in ParserCheckZeroLengthString function, code starts behaving correctly again. How to diagnose or fix this issue.?

0 Kudos
Reply