183 of 198 configurations in contrib/config-list.mk fail to build build with this error: ../../../gcc/gcc/ipa-inline-analysis.c: In function ‘predicate_probability’: ../../../gcc/gcc/ipa-inline-analysis.c:485:8: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ../../../gcc/gcc/ipa-inline-analysis.c: In function ‘remap_edge_change_prob’: ../../../gcc/gcc/ipa-inline-analysis.c:2356:5: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] cc1: all warnings being treated as errors (the other configurations fail for other reasons) I have used a native compiler previously bootstrapped from the same sources. I see that for the boostrap, ipa-inline-analysis.o was built once with the bootstrap compiler, and twice with the previous stage g++. For the cross-compilation, on the other hand, gcc is used (even though g++ is also available), with the additional options: -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wc++-compat
Native builds of current trunk (mine is gcc-4.7-20110924 == r179148) also fail in the same way, when configured with --disable-build-poststage1-with-cxx. The reason is that PR50012 (a C++ FE diagnostics bug) causes some warnings in new code to go undetected, until someone does a build in proper C mode. Anyway, for this PR the fix should be: --- gcc-4.7-20110924/gcc/ipa-inline-analysis.c.~1~ 2011-09-23 19:30:34.000000000 +0200 +++ gcc-4.7-20110924/gcc/ipa-inline-analysis.c 2011-09-25 20:39:45.000000000 +0200 @@ -482,8 +482,8 @@ predicate_probability (conditions conds, i2 - predicate_first_dynamic_condition); if (c->code == CHANGED && (c->operand_num - < VEC_length (inline_param_summary_t, - inline_param_summary))) + < (int) VEC_length (inline_param_summary_t, + inline_param_summary))) { int iprob = VEC_index (inline_param_summary_t, inline_param_summary, @@ -2353,8 +2353,8 @@ remap_edge_change_prob (struct cgraph_ed struct ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, i); if (jfunc->type == IPA_JF_PASS_THROUGH && (jfunc->value.pass_through.formal_id - < VEC_length (inline_param_summary_t, - inlined_es->param))) + < (int) VEC_length (inline_param_summary_t, + inlined_es->param))) { int prob1 = VEC_index (inline_param_summary_t, es->param, i)->change_prob;
Probably fixed by Richard Sandiford in r179268.
(In reply to comment #2) > Probably fixed by Richard Sandiford in r179268. I can confirm that the file builds fine in r184927