https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71657
Bug ID: 71657 Summary: Wrong code on trunk gcc (std::out_of_range), westmere Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: anton.mitrokhin at phystech dot edu Target Milestone: --- Created attachment 38767 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38767&action=edit Reproducer It looks like there is some king of overflow while computing array index (which is actually should be correct) This happens only on westmere, O3/Ofast Compile: > g++ -std=c++11 -static-libgcc -static-libstdc++ -O3 -march=westmere -o out > crash_init.cpp crash_main.cpp Run: > ./out Output: terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 20751846) >= this->size() (which is 38) Aborted (core dumped) > gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/export/users/amitrokh/gcc_trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /export/users/gnutester/stability/svn/trunk/configure --with-arch=corei7 --with-cpu=corei7 --enable-clocale=gnu --with-system-zlib --enable-shared --with-demangler-in-ld --enable-cloog-backend=isl --with-fpmath=sse --with-pkgversion=Revision=237716/svn-rev:237719/ --prefix=/export/users/gnutester/stability/work/trunk/64/install --enable-languages=c,c++,fortran,java,lto Thread model: posix gcc version 7.0.0 20160622 (experimental) (Revision=237716/svn-rev:237719/)