It looks like this was failing on x86-64 before my patch: In constructor ‘S::S(int)’, inlined from ‘void __static_initialization_and_destruction_0()’ at a.c:26:7, inlined from ‘(static initializers for a.c)’ at a.c:26:8: a.c:22:24: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’ writing between 4 and 85899 34588 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] 22 | new (p + i) int (); /* { dg-bogus "bounds" "pr102690" { xfail *-*-* } } */ | ^ a.c:19:51: note: destination object of size 0 allocated by ‘operator new []’ 19 | p = (int*) new unsigned char [sizeof (int) * m]; |
and now it's just failing on -m32 as well. This is the same thing as I reported in PR107561, where -Wstringop-overflow is getting the same exact IL as before, but some ranges are different, and it's throwing the warning off. Aldy On Tue, Nov 8, 2022 at 9:22 AM haochen.jiang <haoch...@ecsmtp.sh.intel.com> wrote: > > On Linux/x86_64, > > a239a63f868e29e9276088e7c0fb00804c2903ba is the first bad commit > commit a239a63f868e29e9276088e7c0fb00804c2903ba > Author: Aldy Hernandez <al...@redhat.com> > Date: Fri Nov 4 22:24:42 2022 +0100 > > Improve multiplication by powers of 2 in range-ops. > > caused > > FAIL: g++.dg/pr71488.C (test for excess errors) > FAIL: g++.dg/warn/Warray-bounds-16.C -std=gnu++14 (test for excess errors) > FAIL: g++.dg/warn/Warray-bounds-16.C -std=gnu++17 (test for excess errors) > FAIL: g++.dg/warn/Warray-bounds-16.C -std=gnu++20 (test for excess errors) > FAIL: g++.dg/warn/Warray-bounds-16.C -std=gnu++98 (test for excess errors) > > with GCC configured with > > ../../gcc/configure > --prefix=/export/users/haochenj/src/gcc-bisect/master/master/r13-3761/usr > --enable-clocale=gnu --with-system-zlib --with-demangler-in-ld > --with-fpmath=sse --enable-languages=c,c++,fortran --enable-cet --without-isl > --enable-libmpx x86_64-linux --disable-bootstrap > > To reproduce: > > $ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=g++.dg/pr71488.C > --target_board='unix{-m32}'" > $ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=g++.dg/pr71488.C > --target_board='unix{-m32\ -march=cascadelake}'" > $ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=g++.dg/pr71488.C > --target_board='unix{-m64}'" > $ cd {build_dir}/gcc && make check RUNTESTFLAGS="dg.exp=g++.dg/pr71488.C > --target_board='unix{-m64\ -march=cascadelake}'" > $ cd {build_dir}/gcc && make check > RUNTESTFLAGS="dg.exp=g++.dg/warn/Warray-bounds-16.C > --target_board='unix{-m32}'" > $ cd {build_dir}/gcc && make check > RUNTESTFLAGS="dg.exp=g++.dg/warn/Warray-bounds-16.C > --target_board='unix{-m32\ -march=cascadelake}'" > > (Please do not reply to this email, for question about this report, contact > me at haochen dot jiang at intel.com) >