Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc-13 triggers EXPECT_EQ floating point comparison failure #2718

Open
drew-parsons opened this issue Jul 26, 2023 · 2 comments
Open

gcc-13 triggers EXPECT_EQ floating point comparison failure #2718

drew-parsons opened this issue Jul 26, 2023 · 2 comments

Comments

@drew-parsons
Copy link
Contributor

drew-parsons commented Jul 26, 2023

#2435 (PR #2436) fixed some instances of EXPECT_EQ being used for floating point comparison instead of EXPECT_DOUBLE_EQ.
gcc-13 appears to have uncovered a few more, causing test failure on i386 and s390x. Tests were previously passing with gcc-12 and are still passing with clang.

Test logs are available for i386 (xtensor 0.24.6)

The error is

861s ./test_xtensor_lib
861s [doctest] doctest version is "2.4.11"
861s [doctest] run with "--help" for options
861s Built without XSIMD
861s Built without XSIMD
861s ===============================================================================
861s /tmp/autopkgtest-lxc.h85ujcsf/downtmp/autopkgtest_tmp/test_xbuilder.cpp:146:
861s TEST CASE:  xbuilder.arange_min_max_step
861s 
861s /tmp/autopkgtest-lxc.h85ujcsf/downtmp/autopkgtest_tmp/test_xbuilder.cpp:166: FATAL ERROR: REQUIRE_EQ( 3.f * 0.3f, l3[{3}] ) is NOT correct!
861s   values: REQUIRE_EQ( 0.9, 0.9 )
861s 
861s ===============================================================================
861s /tmp/autopkgtest-lxc.h85ujcsf/downtmp/autopkgtest_tmp/test_xcomplex.cpp:297:
861s TEST CASE:  xcomplex.longdouble
861s 
861s /tmp/autopkgtest-lxc.h85ujcsf/downtmp/autopkgtest_tmp/test_xcomplex.cpp:304: ERROR: CHECK_EQ( a(4, 4), cmplx(123.321, -123.321) ) is NOT correct!
861s   values: CHECK_EQ( (123.321,-123.321), (123.321,-123.321) )
861s 
861s /tmp/autopkgtest-lxc.h85ujcsf/downtmp/autopkgtest_tmp/test_xcomplex.cpp:308: ERROR: CHECK_EQ( a(0, 0), cmplx(-123.321, -123.321) ) is NOT correct!
861s   values: CHECK_EQ( (-123.321,-123.321), (-123.321,-123.321) )
861s 
861s /tmp/autopkgtest-lxc.h85ujcsf/downtmp/autopkgtest_tmp/test_xcomplex.cpp:309: ERROR: CHECK_EQ( a(4, 4), cmplx(-123.321, -123.321) ) is NOT correct!
861s   values: CHECK_EQ( (-123.321,-123.321), (-123.321,-123.321) )
861s 
861s ===============================================================================
861s [doctest] test cases:  1196 |  1194 passed | 2 failed | 0 skipped
861s [doctest] assertions: 19564 | 19560 passed | 4 failed |
861s [doctest] Status: FAILURE!

As far as I can tell it's just further instances where EXPECT_DOUBLE_EQ is required instead of EXPECT_EQ, or similar, following the example of #2436

The gcc-13 trigger might be excess precision changes, https://gcc.gnu.org/gcc-13/porting_to.html

@drew-parsons
Copy link
Contributor Author

drew-parsons commented Aug 3, 2023

l.33 in test_xinfo.cpp is also expected to be a problem with llvm-16. But this is a string comparison not a floating point comparison, so can't be fixed the same way. Why would llvm-16 be returning "le" instead of "double"? Is it a bug in llvm-16?

@drew-parsons
Copy link
Contributor Author

drew-parsons commented Sep 25, 2023

The latter problem with test_xinfo and llvm-16 is Issue #2694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant