g:86cca5cc14602814b98e55aae313fbe237af1b04, r11-4921 commit 86cca5cc14602814b98e55aae313fbe237af1b04 Author: Richard Biener <rguenther@suse.de> Date: Wed Nov 11 16:09:17 2020 +0100 /bin/sh ../libtool --tag=CC --mode=compile /home/seurer/gcc/git/build/gcc-test/./prev-gcc/xgcc -B/home/seurer/gcc/git/build/gcc-test/./prev-gcc/ -B/home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/bin/ -B/home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/bin/ -B/home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/lib/ -isystem /home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/include -isystem /home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/sys-include -fchecking=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_LOCALE_H=1 -DHAVE_WCHAR_H=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_STRUCT_LCONV_DECIMAL_POINT=1 -DHAVE_STRUCT_LCONV_THOUSANDS_SEP=1 -DHAVE_ALLOCA_H=1 -DHAVE_STDINT_H=1 -DHAVE_VA_COPY=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_LONG_LONG=1 -DHAVE_INTMAX_T=1 -DMPFR_HAVE_INTMAX_MAX=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_DENORMS=1 -DHAVE_SIGNEDZ=1 -DHAVE_ROUND=1 -DHAVE_TRUNC=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_NEARBYINT=1 -DMPFR_USE_THREAD_SAFE=1 -DMPFR_USE_C11_THREAD_SAFE=1 -DHAVE_CLOCK_GETTIME=1 -DLT_OBJDIR=\".libs/\" -DHAVE_ATTRIBUTE_MODE=1 -DHAVE___GMPN_ROOTREM=1 -DHAVE___GMPN_SBPI1_DIVAPPR_Q=1 -I. -I/home/seurer/gcc/git/gcc-test/mpfr/src -I/home/seurer/gcc/git/build/gcc-test/gmp -DNO_ASM -g -O2 -fchecking=1 -MT sub1sp.lo -MD -MP -MF .deps/sub1sp.Tpo -c -o sub1sp.lo /home/seurer/gcc/git/gcc-test/mpfr/src/sub1sp.c libtool: compile: /home/seurer/gcc/git/build/gcc-test/./prev-gcc/xgcc -B/home/seurer/gcc/git/build/gcc-test/./prev-gcc/ -B/home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/bin/ -B/home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/bin/ -B/home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/lib/ -isystem /home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/include -isystem /home/seurer/gcc/git/install/gcc-test/powerpc64-unknown-linux-gnu/sys-include -fchecking=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_LOCALE_H=1 -DHAVE_WCHAR_H=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_STRUCT_LCONV_DECIMAL_POINT=1 -DHAVE_STRUCT_LCONV_THOUSANDS_SEP=1 -DHAVE_ALLOCA_H=1 -DHAVE_STDINT_H=1 -DHAVE_VA_COPY=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_LONG_LONG=1 -DHAVE_INTMAX_T=1 -DMPFR_HAVE_INTMAX_MAX=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_DENORMS=1 -DHAVE_SIGNEDZ=1 -DHAVE_ROUND=1 -DHAVE_TRUNC=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_NEARBYINT=1 -DMPFR_USE_THREAD_SAFE=1 -DMPFR_USE_C11_THREAD_SAFE=1 -DHAVE_CLOCK_GETTIME=1 -DLT_OBJDIR=\".libs/\" -DHAVE_ATTRIBUTE_MODE=1 -DHAVE___GMPN_ROOTREM=1 -DHAVE___GMPN_SBPI1_DIVAPPR_Q=1 -I. -I/home/seurer/gcc/git/gcc-test/mpfr/src -I/home/seurer/gcc/git/build/gcc-test/gmp -DNO_ASM -g -O2 -fchecking=1 -MT sub1sp.lo -MD -MP -MF .deps/sub1sp.Tpo -c /home/seurer/gcc/git/gcc-test/mpfr/src/sub1sp.c -o sub1sp.o during GIMPLE pass: pre /home/seurer/gcc/git/gcc-test/mpfr/src/sub1sp.c: In function 'mpfr_sub1sp': /home/seurer/gcc/git/gcc-test/mpfr/src/sub1sp.c:135:1: internal compiler error: in clean, at tree-ssa-pre.c:2053 135 | mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) | ^~~~~~~~~~~ 0x3fffb7c87c6b generic_start_main ../csu/libc-start.c:266
Mine - trying to reproduce on x86_64-linux with in-tree mpfr.
OK, confirmed and reducing a testcase.
int b; long c; int g(); void h(long *); void i(long *); void d() { int e, f = b - e; if (g()) h(&c + f); else i(&c + f); __builtin_memset(0, 0, f * 8); } heh, quite simple - so much for test coverage :/
OK, happens because topological sorting is not correct for the case where we have multiple expressions for a value in the set.
*** Bug 97809 has been marked as a duplicate of this bug. ***
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:64326bb428ac750ec3b0f56c06dfb98277cd41b5 commit r11-4937-g64326bb428ac750ec3b0f56c06dfb98277cd41b5 Author: Richard Biener <rguenther@suse.de> Date: Thu Nov 12 09:10:51 2020 +0100 tree-optimization/97806 - fix PRE expression post order This fixes the postorder compute for the case of multiple expression leaders for a value. 2020-11-12 Richard Biener <rguenther@suse.de> PR tree-optimization/97806 * tree-ssa-pre.c (pre_expr_DFS): New overload for visiting values, visiting all leaders for a value. Use a bitmap for visited values. (sorted_array_from_bitmap_set): Walk over values and adjust. * gcc.dg/pr97806.c: New testcase.
Fixed.