[r12-5236 Regression] FAIL: gcc.dg/tree-prof/merge_block.c scan-tree-dump-not optimized "Invalid sum" on Linux/x86_64

Jan Hubicka hubicka@kam.mff.cuni.cz
Sun Nov 14 10:49:19 GMT 2021


> On Linux/x86_64,
> 
> 5aa91072e24c1e16a5ec641b48b64c9c9f199f13 is the first bad commit
> commit 5aa91072e24c1e16a5ec641b48b64c9c9f199f13
> Author: Jan Hubicka <jh@suse.cz>
> Date:   Sat Nov 13 22:25:23 2021 +0100
> 
>     Implement DSE of dead functions calls storing memory.
> 
> caused
> 
> FAIL: c-c++-common/tsan/free_race2.c   -O2  execution test
> FAIL: c-c++-common/tsan/free_race.c   -O2  execution test
> FAIL: gcc.dg/ipa/ipa-sra-4.c scan-ipa-dump-times sra "Will split parameter" 2
> FAIL: gcc.dg/tree-prof/merge_block.c scan-tree-dump-not optimized "Invalid sum"
> 
> with GCC configured with
> 
> ../../gcc/configure --prefix=/local/skpandey/gccwork/toolwork/gcc-bisect-master/master/r12-5236/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="tsan.exp=c-c++-common/tsan/free_race2.c --target_board='unix{-m64}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="tsan.exp=c-c++-common/tsan/free_race2.c --target_board='unix{-m64\ -march=cascadelake}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="tsan.exp=c-c++-common/tsan/free_race.c --target_board='unix{-m64}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="tsan.exp=c-c++-common/tsan/free_race.c --target_board='unix{-m64\ -march=cascadelake}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="ipa.exp=gcc.dg/ipa/ipa-sra-4.c --target_board='unix{-m32}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="ipa.exp=gcc.dg/ipa/ipa-sra-4.c --target_board='unix{-m32\ -march=cascadelake}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="ipa.exp=gcc.dg/ipa/ipa-sra-4.c --target_board='unix{-m64}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="ipa.exp=gcc.dg/ipa/ipa-sra-4.c --target_board='unix{-m64\ -march=cascadelake}'"

In these two cases we do DSE and the testcase is no longer getting what
it wants (invalid store or SRA transform).  I had patch adding
-fno-ipa-modref and will commit it.

> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="tree-prof.exp=gcc.dg/tree-prof/merge_block.c --target_board='unix{-m32}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="tree-prof.exp=gcc.dg/tree-prof/merge_block.c --target_board='unix{-m32\ -march=cascadelake}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="tree-prof.exp=gcc.dg/tree-prof/merge_block.c --target_board='unix{-m64}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="tree-prof.exp=gcc.dg/tree-prof/merge_block.c --target_board='unix{-m64\ -march=cascadelake}'"

This seems real bug in complete loop unrolling.  Not sure what broke
here, but cunrolli now does not get frequencies right.

Honza


More information about the Gcc-patches mailing list