https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78735
Bug ID: 78735 Summary: profiledbootstrap with --enable-checking=yes,rtl fails on trunk due to -Werror=strict-overflow Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: sirl at gcc dot gnu.org Target Milestone: --- Hi, current trunk (tried r243299 and r243376) on x86_64 fails a profiledbootstrap with --enable-checking=yes,rtl like that: /home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/obj-x86_64-suse-linux/./prev-gcc/xg++ -B/home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/obj-x86_64-suse-linux/./prev-gcc/ -B/usr/x86_64-suse-linux/bin/ -nostdinc++ -B/home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/src/.libs -B/home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/libsupc++/.libs -I/home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/include/x86_64-suse-linux -I/home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/include -I/home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/libstdc++-v3/libsupc++ -L/home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/src/.libs -L/home/fsirl/rpmbuild/BUILD/gcc-7.0.0-r243376/obj-x86_64-suse-linux/prev-x86_64-suse-linux/libstdc++-v3/libsupc++/.libs -fno-PIE -c -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -U_FORTIFY_SOURCE -fprofile-use -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -o combine.o -MT combine.o -MMD -MP -MF ./.deps/combine.TPo ../../gcc/combine.c In file included from ../../gcc/combine.c:83:0: ../../gcc/combine.c: In function 'int recog_for_combine(rtx_def**, rtx_insn*, rtx_def**)': ../../gcc/rtl.h:1076:17: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow] if (_i < 0 || _i >= GET_NUM_ELEM (_rtvec)) \ ^ ../../gcc/rtl.h:702:45: note: in definition of macro 'GET_CODE' #define GET_CODE(RTX) ((enum rtx_code) (RTX)->code) ^~~ ../../gcc/rtl.h:1298:28: note: in expansion of macro 'RTVEC_ELT' #define XVECEXP(RTX, N, M) RTVEC_ELT (XVEC (RTX, N), M) ^~~~~~~~~ ../../gcc/combine.c:11088:21: note: in expansion of macro 'XVECEXP' if (GET_CODE (XVECEXP (pat, 0, i)) == CLOBBER ^~~~~~~ ../../gcc/rtl.h:1076:17: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow] if (_i < 0 || _i >= GET_NUM_ELEM (_rtvec)) \ ^ ../../gcc/rtl.h:702:45: note: in definition of macro 'GET_CODE' #define GET_CODE(RTX) ((enum rtx_code) (RTX)->code) ^~~ ../../gcc/rtl.h:1298:28: note: in expansion of macro 'RTVEC_ELT' #define XVECEXP(RTX, N, M) RTVEC_ELT (XVEC (RTX, N), M) ^~~~~~~~~ ../../gcc/combine.c:11088:21: note: in expansion of macro 'XVECEXP' if (GET_CODE (XVECEXP (pat, 0, i)) == CLOBBER ^~~~~~~ ../../gcc/rtl.h:1076:17: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow] if (_i < 0 || _i >= GET_NUM_ELEM (_rtvec)) \ ^ ../../gcc/rtl.h:702:45: note: in definition of macro 'GET_CODE' #define GET_CODE(RTX) ((enum rtx_code) (RTX)->code) ^~~ ../../gcc/rtl.h:1298:28: note: in expansion of macro 'RTVEC_ELT' #define XVECEXP(RTX, N, M) RTVEC_ELT (XVEC (RTX, N), M) ^~~~~~~~~ ../../gcc/combine.c:11088:21: note: in expansion of macro 'XVECEXP' if (GET_CODE (XVECEXP (pat, 0, i)) == CLOBBER ^~~~~~~ More of the same errors follow. A simple "make bootstrap" works fine. The build (actually the SRCRPM from OBS with updated sources) was configured like that: CFLAGS='-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -U_FORTIFY_SOURCE' CXXFLAGS='-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -U_FORTIFY_SOURCE' XCFLAGS='-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -U_FORTIFY_SOURCE' TCFLAGS='-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -U_FORTIFY_SOURCE' ../configure CC=gcc-6 CXX=g++-6 --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,go --enable-checking=yes,rtl --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1 --disable-plugin --with-bugurl=http://bugs.opensuse.org/ '--with-pkgversion=SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --with-default-libstdcxx-abi=gcc4-compatible --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-7 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux make profiledbootstrap STAGE1_CFLAGS=-g 'BOOT_CFLAGS=-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -U_FORTIFY_SOURCE'