https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118616
Bug ID: 118616 Summary: [15 regression] -Waggressive-loop-optimizations warnings in tree-vect-generic.cc on x86 Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: build Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: sjames at gcc dot gnu.org Target Milestone: --- In member function ‘operator[]’, inlined from ‘operator[]’ at /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/vec.h:1599:20, inlined from ‘expand_vector_conversion’ at /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/tree-vect-generic.cc:1766:39: /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/vec.h:911:23: warning: iteration 536870912 invokes undefined behavior [-Waggressive-loop-optimizations] 911 | return address ()[ix]; | ^ /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/tree-vect-generic.cc: In function ‘expand_vector_conversion’: /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/tree-vect-generic.cc:1764:34: note: within this loop 1764 | for (unsigned int i = 0; i < converts.length () - 1; i++) | ^ In member function ‘operator[]’, inlined from ‘operator[]’ at /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/vec.h:1599:20, inlined from ‘expand_vector_conversion’ at /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/tree-vect-generic.cc:1766:39: /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/vec.h:911:23: warning: iteration 536870912 invokes undefined behavior [-Waggressive-loop-optimizations] 911 | return address ()[ix]; | ^ /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/tree-vect-generic.cc: In function ‘expand_vector_conversion’: /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/tree-vect-generic.cc:1764:34: note: within this loop 1764 | for (unsigned int i = 0; i < converts.length () - 1; i++) | ^ --- ``` Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-linux-gnu/15/lto-wrapper Target: i686-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/15 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/15/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/15 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/15/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/15/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/15/include/g++-v15 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/i686-pc-linux-gnu/15/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 15.0.9999 p, commit ed499599c366116171aab1648e7fdb14b70723c8' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --disable-fixed-point --with-arch=i686 --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --enable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --without-isl --enable-default-pie --enable-host-pie --disable-host-bind-now --enable-default-ssp --disable-fixincludes --with-build-config='bootstrap-O3 bootstrap-lto' Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 15.0.1 20250123 (experimental) 4d1befa436bc6526a0e7d594e5f96012a38942c6 (Gentoo 15.0.9999 p, commit ed499599c366116171aab1648e7fdb14b70723c8) ```