This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/57266] New: [4.9 regression] comparison between signed and unsigned integer expressions in fold_binary_loc breaks m68k bootstrap
- From: "mikpe at it dot uu.se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 May 2013 21:13:25 +0000
- Subject: [Bug bootstrap/57266] New: [4.9 regression] comparison between signed and unsigned integer expressions in fold_binary_loc breaks m68k bootstrap
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57266
Bug ID: 57266
Summary: [4.9 regression] comparison between signed and
unsigned integer expressions in fold_binary_loc breaks
m68k bootstrap
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: bootstrap
Assignee: unassigned at gcc dot gnu.org
Reporter: mikpe at it dot uu.se
Attempting to bootstrap gcc-4.9-20130512 on m68k-linux fails with:
/mnt/scratch/objdir49/./prev-gcc/xg++ -B/mnt/scratch/objdir49/./prev-gcc/
-B/mnt/scratch/install49/m68k-unknown-linux-gnu/bin/ -nostdinc++
-B/mnt/scratch/objdir49/prev-m68k-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/mnt/scratch/objdir49/prev-m68k-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/mnt/scratch/objdir49/prev-m68k-unknown-linux-gnu/libstdc++-v3/include/m68k-unknown-linux-gnu
-I/mnt/scratch/objdir49/prev-m68k-unknown-linux-gnu/libstdc++-v3/include
-I/mnt/scratch/gcc-4.9-20130512/libstdc++-v3/libsupc++
-L/mnt/scratch/objdir49/prev-m68k-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/mnt/scratch/objdir49/prev-m68k-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-c -g -O2 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Werror -DHAVE_CONFIG_H -I. -I.
-I/mnt/scratch/gcc-4.9-20130512/gcc -I/mnt/scratch/gcc-4.9-20130512/gcc/.
-I/mnt/scratch/gcc-4.9-20130512/gcc/../include
-I/mnt/scratch/gcc-4.9-20130512/gcc/../libcpp/include
-I/mnt/scratch/gcc-4.9-20130512/gcc/../libdecnumber
-I/mnt/scratch/gcc-4.9-20130512/gcc/../libdecnumber/dpd -I../libdecnumber
-I/mnt/scratch/gcc-4.9-20130512/gcc/../libbacktrace
/mnt/scratch/gcc-4.9-20130512/gcc/fold-const.c -o fold-const.o
/mnt/scratch/gcc-4.9-20130512/gcc/fold-const.c: In function 'tree_node*
fold_binary_loc(location_t, tree_code, tree, tree, tree)':
/mnt/scratch/gcc-4.9-20130512/gcc/fold-const.c:12430:15: error: comparison
between signed and unsigned integer expressions [-Werror=sign-compare]
if (low >= prec)
^
cc1plus: all warnings being treated as errors
make[3]: *** [fold-const.o] Error 1
make[3]: Leaving directory `/mnt/scratch/objdir49/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/mnt/scratch/objdir49'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/mnt/scratch/objdir49'
make: *** [bootstrap] Error 2
At this point in the source, 'low' is of type HOST_WIDE_INT which is 'long' (32
bits on m68k) while 'prec' is of type 'unsigned int' (also 32 bits).
Caused by r198772. Before that the code compared 'low' with TYPE_PRECISION (),
which is a smaller-than-int unsigned bitfield, so presumably promoted to int.
Casting prec to HOST_WIDE_INT here seems to work.