https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118464
Bug ID: 118464 Summary: gcc-15.0.0_pre20250112 ICE with opencv-4.10.0 using -O2/-ftree-loop-vectorize: memory_descriptor_ref.cpp:94:19: internal compiler error: in exact_div, at poly-int.h:2160 Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ted.d.rodgers at gmail dot com Target Milestone: --- FAILED: CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp.o /usr/bin/x86_64-pc-linux-gnu-g++ -I/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/include -isystem /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12 -march=native -O2 -mprefer-vector-width=512 -fno-vect-cost-model -pipe -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mf16c -mfma -mavx -mavx2 -mavx512f -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -std=c++17 -fPIC -MD -MT CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp.o -MF CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp.o.d -o CMakeFiles/ade.dir/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp.o -c /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp In file included from /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/include/ade/memory/memory_types.hpp:14, from /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/include/ade/memory/memory_descriptor_ref.hpp:14, from /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp:9: /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/include/ade/util/md_view.hpp:47:46: warning: ‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator’ is deprecated [-Wdeprecated-declarations] 47 | class MdViewIteratorImpl final : public std::iterator<std::random_access_iterator_tag, DiffT> | ^~~~~~~~ In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/stl_iterator_base_funcs.h:68, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/string:49, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/locale_classes.h:42, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/ios_base.h:43, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/ios:46, from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/ostream:42, from /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp:7: /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/stl_iterator_base_types.h:129:34: note: declared here 129 | struct _GLIBCXX17_DEPRECATED iterator | ^~~~~~~~ during GIMPLE pass: vect /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp: In member function ‘ade::memory::DynMdSpan ade::MemoryDescriptorRef::originSpan() const’: /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64-python3_12/3rdparty/ade/ade-0.1.2d/sources/ade/source/memory_descriptor_ref.cpp:94:19: internal compiler error: in exact_div, at poly-int.h:2160 94 | memory::DynMdSpan MemoryDescriptorRef::originSpan() const | ^~~~~~~~~~~~~~~~~~~ 0x557df1d45f8b internal_error(char const*, ...) /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/diagnostic-global-context.cc:517 0x557def55449f fancy_abort(char const*, int, char const*) /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/diagnostic.cc:1722 0x557def5080cf poly_int<1u, poly_result<unsigned long, if_nonpoly<int, int, poly_int_traits<int>::is_poly>::type, poly_coeff_pair_traits<unsigned long, if_nonpoly<int, int, poly_int_traits<int>::is_poly>::type>::result_kind>::type> exact_div<1u, unsigned long, int>(poly_int<1u, unsigned long> const&, int) /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/poly-int.h:2160 0x557def5080cf vect_compute_data_ref_alignment /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/tree-vect-data-refs.cc:1365 0x557df1c20bee vect_analyze_data_refs_alignment(_loop_vec_info*) /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/tree-vect-data-refs.cc:2946 0x557df05dd0eb vect_analyze_loop_2 /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/tree-vect-loop.cc:2959 0x557df05df562 vect_analyze_loop_1 /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/tree-vect-loop.cc:3478 0x557df05dfe6b vect_analyze_loop(loop*, gimple*, vec_info_shared*) /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/tree-vect-loop.cc:3638 0x557df06492ba try_vectorize_loop_1 /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/tree-vectorizer.cc:1093 0x557df06492ba try_vectorize_loop /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/tree-vectorizer.cc:1210 0x557df0649cd0 execute /usr/src/debug/sys-devel/gcc-15.0.0_pre20250112/gcc-15-20250112/gcc/tree-vectorizer.cc:1326 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. Attached .ii fails with: g++ -O1 -ftree-loop-vectorize -pipe -fsigned-char -pthread -ffunction-sections -fdata-sections -mpopcnt -fvisibility=hidden -fvisibility-inlines-hidden -std=c++17 -o memory_descriptor_ref.cpp.o -c memory_descriptor_ref.cpp.ii Builds Successfully with: g++ -O1 -pipe -fsigned-char -pthread -ffunction-sections -fdata-sections -mpopcnt -fvisibility=hidden -fvisibility-inlines-hidden -std=c++17 -o memory_descriptor_ref.cpp.o -c memory_descriptor_ref.cpp.ii Reducing the .ii file, will upload when completed