http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50743
Bug #: 50743 Summary: [4.7 regression] objc-act.c triggers -Werror=sign-compare breaking bootstrap Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: objc AssignedTo: unassig...@gcc.gnu.org ReportedBy: mi...@it.uu.se Attempting to bootstrap gcc-4.7-20111015 with objc enabled and --disable-build-poststage1-with-cxx fails with: /mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c: In function 'check_duplicates': /mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c:5073:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] /mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c:5106:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] /mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c: In function 'insert_method_into_method_map': /mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c:5828:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] /mnt/scratch/gcc-4.7-20111015/gcc/objc/objc-act.c:5840:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] cc1: all warnings being treated as errors make[3]: *** [objc/objc-act.o] Error 1 make[3]: Leaving directory `/mnt/scratch/objdir47/gcc' make[2]: *** [all-stage2-gcc] Error 2 make[2]: Leaving directory `/mnt/scratch/objdir47' make[1]: *** [stage2-bubble] Error 2 make[1]: Leaving directory `/mnt/scratch/objdir47' make: *** [bootstrap] Error 2 This is a regression from r179965: http://gcc.gnu.org/ml/gcc-cvs/2011-10/msg00561.html The issue is that the code was rewritten to use a number or for-loops with a size_t index and a TREE_VEC_LENGTH limit; however, TREE_VEC_LENGTH returns a signed integer, resulting in a signed/unsigned comparison. The C front-end catches this error, but the C++ front-end fails to do so due to PR50012.