seqan / seqan3

The modern C++ library for sequence analysis. Contains version 3 of the library and API docs.
https://www.seqan.de
Other
406 stars 81 forks source link

GCC 13 errors #3138

Closed sagitter closed 1 year ago

sagitter commented 1 year ago

Does this problem persist on the current master?

Is there an existing issue for this?

Current Behavior

In file included from /builddir/build/BUILD/seqan3-c5ec15bd0682eae350892e120773cf639904f71d/include/seqan3/alignment/matrix/detail/trace_iterator_base.hpp:19,
                 from /builddir/build/BUILD/seqan3-c5ec15bd0682eae350892e120773cf639904f71d/include/seqan3/alignment/matrix/detail/trace_iterator.hpp:15,
                 from /builddir/build/BUILD/seqan3-c5ec15bd0682eae350892e120773cf639904f71d/test/unit/alignment/matrix/detail/aligned_sequence_builder_test.cpp:16:
/builddir/build/BUILD/seqan3-c5ec15bd0682eae350892e120773cf639904f71d/include/seqan3/alignment/matrix/detail/two_dimensional_matrix_iterator_base.hpp: In instantiation of 'class seqan3::detail::two_dimensional_matrix_iterator_base<seqan3::detail::two_dimensional_matrix<seqan3::detail::trace_directions>::basic_iterator<false>, seqan3::detail::matrix_major_order::row>':
/builddir/build/BUILD/seqan3-c5ec15bd0682eae350892e120773cf639904f71d/include/seqan3/alignment/matrix/detail/two_dimensional_matrix.hpp:324:60:   required from 'class seqan3::detail::two_dimensional_matrix<seqan3::detail::trace_directions>::basic_iterator<false>'
/builddir/build/BUILD/seqan3-c5ec15bd0682eae350892e120773cf639904f71d/test/unit/alignment/matrix/detail/aligned_sequence_builder_test.cpp:61:85:   required from here
/builddir/build/BUILD/seqan3-c5ec15bd0682eae350892e120773cf639904f71d/include/seqan3/alignment/matrix/detail/two_dimensional_matrix_iterator_base.hpp:85:18: error: redeclaration of 'template<class derived_t, seqan3::detail::matrix_major_order order> class seqan3::detail::two_dimensional_matrix_iterator_base' with different constraints
   85 |     friend class two_dimensional_matrix_iterator_base;
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected Behavior

No errors

Steps To Reproduce

Compiling seqan3 c5ec15bd0682eae350892e120773cf639904f71d in Fedora 39's RPM build system

Environment

- Operating system: Fedora 39 (devel branch) any architecture
- SeqAn version: c5ec15bd0682eae350892e120773cf639904f71d
- Compiler: GCC-13.0.1

Anything else?

Full log attached seqan3.zip

eseiler commented 1 year ago

Hey @sagitter,

Whats the gcc commit? We have nightly builds with the gcc master, and the error doesn't show up

EDIT: Was able to reproduce

sagitter commented 1 year ago

Hey @sagitter,

Hi Enrico. Sorry for the late reply

Whats the gcc commit? We have nightly builds with the gcc master, and the error doesn't show up

I don't know but you can find a Changelog of the GCC RPM (used in this seqan build) here that reports the ID of fixed bug

EDIT: Was able to reproduce

I will compile seqan newly in some days. Thank you

eseiler commented 1 year ago

There are some new errors, I'll leave this issue open until the errors are fixed.

sagitter commented 1 year ago

From commit 174255eea53d4847e7ce8cb0dc29415f177dc54d

/builddir/build/BUILD/seqan3-174255eea53d4847e7ce8cb0dc29415f177dc54d/test/unit/alignment/pairwise/pairwise_alignment_collection_test_template.hpp:45:48:   required from 'void gtest_suite_pairwise_alignment_collection_test_::score<gtest_TypeParam_>::TestBody() [with gtest_TypeParam_ = pairwise_alignment_fixture<(& seqan3::test::alignment::collection::simd::global::affine::banded::dna4_all_same)>]'
/builddir/build/BUILD/seqan3-174255eea53d4847e7ce8cb0dc29415f177dc54d/test/unit/alignment/pairwise/pairwise_alignment_collection_test_template.hpp:40:1:   required from here
/builddir/build/BUILD/seqan3-174255eea53d4847e7ce8cb0dc29415f177dc54d/include/seqan3/alignment/pairwise/detail/pairwise_alignment_algorithm_banded.hpp:368:9: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
  368 |         for (auto && alphabet2 : sequence2 | std::views::drop(1))
      |         ^~~
/builddir/build/BUILD/seqan3-174255eea53d4847e7ce8cb0dc29415f177dc54d/include/seqan3/alignment/pairwise/detail/pairwise_alignment_algorithm_banded.hpp:368:44: note: the temporary was destroyed at the end of the full expression 'std::ranges::views::__adaptor::operator|<_Partial<std::ranges::views::_Drop, int>, std::span<__vector(1) int, 18446744073709551615>&>((* & sequence2), ((const std::ranges::views::__adaptor::_RangeAdaptor<std::ranges::views::_Drop>*)(& std::ranges::views::drop))->std::ranges::views::__adaptor::_RangeAdaptor<std::ranges::views::_Drop>::operator()<int>(1))'
  368 |         for (auto && alphabet2 : sequence2 | std::views::drop(1))
      |                                  ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: Leaving directory '/builddir/build/BUILD/seqan3-174255eea53d4847e7ce8cb0dc29415f177dc54d/build'
gmake[2]: *** [alignment/pairwise/CMakeFiles/global_affine_banded_collection_simd_test.dir/build.make:79: alignment/pairwise/CMakeFiles/global_affine_banded_collection_simd_test.dir/global_affine_banded_collection_simd_test.cpp.o] Error 1

Full log: seqan-git174255ee.zip

With GCC:

* Fri Mar 24 2023 gcc-13.0.1-0.10
- update from trunk
  - PRs analyzer/109239, c++/105996, c++/108390, c++/108795, c++/109177,
    c++/109241, c/84900, fortran/104572, middle-end/109258,
    modula2/107630, modula2/109248, modula2/109264, target/103628,
    target/109137, target/109228, target/109244, testsuite/105959,
    tree-optimization/99739, tree-optimization/107569,
    tree-optimization/109176, tree-optimization/109262
eseiler commented 1 year ago

Yep, there is also a (bogus? ) value-may-be-used-uninitialized and an ICE there. Will probably take a while to fix.

sagitter commented 1 year ago

seqan 8c604d98e0d291bc3909ecbad78ca778b3ad5a5c is correctly compiled with GCC-13

eseiler commented 1 year ago

Yes, the ICE I saw is something weird.

It seems to be related to GoogleTest, SIMD, and LTO. It only affects:

global_affine_banded_collection_simd_test.cpp
global_affine_unbanded_collection_simd_test.cpp
global_affine_unbanded_collection_simd_aa27_test.cpp

If I recall correctly, this happens during linking, not compiling. For now, I just removed the LTO flags (-flto, -ffat-lto-objects).

Anyway, this issue is fixed :)