Created attachment 28153 [details] Preprocessed source /home/dave/gnu/gcc/objdir/./prev-gcc/g++ -B/home/dave/gnu/gcc/objdir/./prev-gcc/ -B/home/dave/opt/gnu/gcc/gcc-4.8.0/hppa-linux-gnu/bin/ -nostdinc++ -B/home/dave /gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/src/.libs -B/home/dave/gnu/gcc/ objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/.libs -I/home/dave/gnu/gcc/obj dir/prev-hppa-linux-gnu/libstdc++-v3/include/hppa-linux-gnu -I/home/dave/gnu/gcc /objdir/prev-hppa-linux-gnu/libstdc++-v3/include -I/home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++ -L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/sr c/.libs -L/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/. libs -c -g -O2 -DIN_GCC -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing -W write-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -W no-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc /gcc/../libcpp/include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libde cnumber/dpd -I../libdecnumber ../../gcc/gcc/mcf.c -o mcf.o In file included from ../../gcc/gcc/mcf.c:47:0: ../../gcc/gcc/mcf.c: In function ‘void dump_fixup_edge(FILE*, fixup_graph_type*, fixup_edge_p)’: ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:211:34: note: in expansion of macro 'CAP_INFINITY' if (fedge->max_capacity == CAP_INFINITY) ^ ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:219:27: note: in expansion of macro 'CAP_INFINITY' if (fedge->rflow == CAP_INFINITY) ^ ../../gcc/gcc/mcf.c: In function ‘void create_fixup_graph(fixup_graph_type*)’: ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:531:28: note: in expansion of macro 'CAP_INFINITY' fcost, CAP_INFINITY); ^ ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:543:23: note: in expansion of macro 'CAP_INFINITY' CAP_INFINITY); ^ ../../gcc/gcc/mcf.c: In function ‘bool cancel_negative_cycle(fixup_graph_type*, int*, gcov_type*, int*)’: ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:806:14: note: in expansion of macro 'CAP_INFINITY' d[i] = CAP_INFINITY; ^ ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:822:34: note: in expansion of macro 'CAP_INFINITY' && d[pfedge->src] != CAP_INFINITY ^ ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:845:32: note: in expansion of macro 'CAP_INFINITY' && d[pfedge->src] != CAP_INFINITY ^ ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:886:16: note: in expansion of macro 'CAP_INFINITY' cycle_flow = CAP_INFINITY; ^ ../../gcc/gcc/mcf.c: In function ‘gcov_type find_max_flow(fixup_graph_type*, int, int)’: ../../gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow] ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) ^ ../../gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM' #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) ^ ../../gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM' #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT) ^ ../../gcc/gcc/mcf.c:1056:29: note: in expansion of macro 'CAP_INFINITY' gcov_type increment = CAP_INFINITY; ^ cc1plus: all warnings being treated as errors make[3]: *** [mcf.o] Error 1 dave@mx3210:~/gnu/gcc/objdir/prev-gcc$ ./xgcc -B./ -v Reading specs from ./specs COLLECT_GCC=./xgcc COLLECT_LTO_WRAPPER=./lto-wrapper Target: hppa-linux-gnu Configured with: ../gcc/configure --with-gnu-as --with-gnu-ld --enable-shared --enable-multiarch --with-multiarch-defaults=hppa-linux-gnu --enable-linker-build-id --build=hppa-linux-gnu --host=hppa-linux-gnu --target=hppa-linux-gnu --prefix=/home/dave/opt/gnu/gcc/gcc-4.8.0 --with-local-prefix=/home/dave/opt/gnu --enable-threads=posix --enable-__cxa_atexit --build=hppa-linux-gnu --enable-clocale=gnu --enable-java-gc=boehm --without-cloog --without-ppl --enable-languages=c,c++,objc,fortran,obj-c++,java,ada,lto Thread model: posix gcc version 4.8.0 20120908 (experimental) [trunk revision 191088] (GCC)
Introduced in revision 191047 (change to new double_int interface).
I got these errors too, when trying to bootstrap gcc-4.8-20120909 on m68k-linux using g++ 4.5.3 as the bootstrap compiler.
Created attachment 28177 [details] Patch that "fixes" the problem
(In reply to comment #3) > Created attachment 28177 [details] > Patch that "fixes" the problem Works for me. I believe the problem is the overflow detection in the new code.
The bug is still present in gcc-4.8-20120923.
Based on my testing, this was fixed by Lawrence's commit on the 24th. It added double_int::sub_with_overflow and double_int::neg_with_overflow to fix the problem.