Skip to content

core: hal: With GCC14, some hal_intrin128.*_CPP_EMULATOR tests are failed. #25674

@Kumataro

Description

@Kumataro

System Information

OpenCV version: 4.10.0-pre (4.9.0-531-g79af357cf4)
Operating System / Platform: Ubuntu 24.04
Compiler & compiler version: GCC 14.0.1

Detailed description

I faced strange test result with Ubuntu24.04 and GCC14 ,
I can't find the root cause at all, so I would like to share the problem with the OpenCV community.

I build OpenCV4(4.x) with GCC14 and run ./bin/opencv_test_core --gtest_filter="*hal_intrin*CPP*" .
Unexpectedly some test are failed.

[  FAILED  ] hal_intrin128.int32x4_CPP_EMULATOR
[  FAILED  ] hal_intrin128.uint32x4_CPP_EMULATOR
[  FAILED  ] hal_intrin128.uint64x2_CPP_EMULATOR
[  FAILED  ] hal_intrin128.int64x2_CPP_EMULATOR
[  FAILED  ] hal_intrin128.float32x4_CPP_EMULATOR
[  FAILED  ] hal_intrin128.float64x2_CPP_EMULATOR

But this result is very strange. It seems that both values are same, however google test determine they are not same.

[ RUN      ] hal_intrin128.int32x4_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_int32()
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:277: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:278: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:283: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
[  FAILED  ] hal_intrin128.int32x4_CPP_EMULATOR (0 ms)

I investigated this problem, however I know only it may or may related with GCC optimization.
I have no more options to debug it.

  • I try to debug it with "debug build", however tests are passed successfully.
  • I try to show data details with "std::hex" operator, however tests are passed successfully.
all test log ---------------------------------------
kmtr@kmtr-VMware-Virtual-Platform:~/work/build4-main_gcc14$ ./bin/opencv_test_core  --gtest_filter="*hal_intrin*CPP*"
CTEST_FULL_OUTPUT
OpenCV version: 4.10.0-pre
OpenCV VCS version: 4.9.0-531-g79af357cf4
Build type: Release
Compiler: /usr/bin/g++-14  (ver 14.0.1)
Parallel framework: pthreads (nthreads=8)
CPU features: SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?
Intel(R) IPP version: ippIP AVX2 (l9) 2021.11.0 (-) Feb  1 2024
Intel(R) IPP features code: 0x8000
OpenCL is disabled
TEST: Skip tests with tags: 'mem_6gb', 'verylong'
Note: Google Test filter = *hal_intrin*CPP*
[==========] Running 10 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 10 tests from hal_intrin128
[ RUN      ] hal_intrin128.uint8x16_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_uint8()
[       OK ] hal_intrin128.uint8x16_CPP_EMULATOR (1 ms)
[ RUN      ] hal_intrin128.int8x16_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_int8()
[       OK ] hal_intrin128.int8x16_CPP_EMULATOR (0 ms)
[ RUN      ] hal_intrin128.uint16x8_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_uint16()
[       OK ] hal_intrin128.uint16x8_CPP_EMULATOR (0 ms)
[ RUN      ] hal_intrin128.int16x8_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_int16()
[       OK ] hal_intrin128.int16x8_CPP_EMULATOR (0 ms)
[ RUN      ] hal_intrin128.int32x4_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_int32()
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:277: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:278: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:283: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
[  FAILED  ] hal_intrin128.int32x4_CPP_EMULATOR (0 ms)
[ RUN      ] hal_intrin128.uint32x4_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_uint32()
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:277: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:278: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:283: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
[  FAILED  ] hal_intrin128.uint32x4_CPP_EMULATOR (0 ms)
[ RUN      ] hal_intrin128.uint64x2_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_uint64()
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:277: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:278: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:279: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:280: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:283: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
[  FAILED  ] hal_intrin128.uint64x2_CPP_EMULATOR (1 ms)
[ RUN      ] hal_intrin128.int64x2_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_int64()
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:277: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:278: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:279: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:280: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:283: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
[  FAILED  ] hal_intrin128.int64x2_CPP_EMULATOR (0 ms)
[ RUN      ] hal_intrin128.float32x4_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_float32()
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:277: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:278: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:279: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:280: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2, 3, 4 }
  out.a
    Which is: { 1, 2, 3, 4 }
[  FAILED  ] hal_intrin128.float32x4_CPP_EMULATOR (0 ms)
[ RUN      ] hal_intrin128.float64x2_CPP_EMULATOR
SIMD128: void opencv_test::hal::intrin128::opt_EMULATOR_CPP::test_hal_intrin_float64()
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:277: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:278: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:279: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:280: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
/home/kmtr/work/opencv4/modules/core/test/test_intrin_utils.hpp:283: Failure
Expected equality of these values:
  data.a
    Which is: { 1, 2 }
  out.a
    Which is: { 1, 2 }
[  FAILED  ] hal_intrin128.float64x2_CPP_EMULATOR (0 ms)
[----------] 10 tests from hal_intrin128 (2 ms total)

[----------] Global test environment tear-down
[==========] 10 tests from 1 test case ran. (2 ms total)
[  PASSED  ] 4 tests.
[  FAILED  ] 6 tests, listed below:
[  FAILED  ] hal_intrin128.int32x4_CPP_EMULATOR
[  FAILED  ] hal_intrin128.uint32x4_CPP_EMULATOR
[  FAILED  ] hal_intrin128.uint64x2_CPP_EMULATOR
[  FAILED  ] hal_intrin128.int64x2_CPP_EMULATOR
[  FAILED  ] hal_intrin128.float32x4_CPP_EMULATOR
[  FAILED  ] hal_intrin128.float64x2_CPP_EMULATOR

 6 FAILED TESTS

Steps to reproduce

sudo apt install g++-14 gcc-14
cmake -S opencv4 -B build4-main_gcc14 -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_C_COMPILER=gcc-14 -GNinja
cmake --build build4-main_gcc14 
cd build4-main_gcc14 
./bin/opencv_test_core  --gtest_filter="*hal_intrin*CPP*"

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions