Hi Jeff, it turned out, that the changed symmetric condition in the warning hit at several places, but also caused two false positives which I had to address first. I tried also building a recent glibc, which hit a false positive when using __builtin_isinf_sign in boolean context, which is used extensively by glibc. Furtunately there were zero new warnings in linux, well done Linus ;) glibc's math.h has this definition: # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ # define isinf(x) __builtin_isinf_sign (x) and __builtin_isinf_sign(x) is internally folded as isinf(x) ? (signbit(x) ? -1 : 1) : 0 which can trigger the warning if used in a boolean context. We do not want to warn for if (isinf(x)) of course. The other false positive was in dwarf2out, where we have this: ../../gcc-trunk/gcc/dwarf2out.c:26166:35: error: ?: using integer constants in boolean context [-Werror=int-in-bool-context] if (s->refcount == ((DEBUG_STR_SECTION_FLAGS & SECTION_MERGE) ? 1 : 2)) ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ and: #define DEBUG_STR_SECTION_FLAGS \ (HAVE_GAS_SHF_MERGE && flag_merge_debug_strings \ ? SECTION_DEBUG | SECTION_MERGE | SECTION_STRINGS | 1 \ : SECTION_DEBUG) which got folded in C++ to if (s->refcount == ((flag_merge_debug_strings ? SECTION_MERGE : 0) ? 1 : 2)) Because SECTION_MERGE = 0x08000, the condition for the warning is satisfied here, but that is only an artifact that is created by the folding of the outer COND_EXPR. Additional to what you suggested, I relaxed the condition even more, because I think it is also suspicious, if one of the branches is known to be outside [0:1] and the other is unknown. That caused another warning in the fortran FE, which was caused by wrong placement of braces in gfc_simplify_repeat. We have: #define mpz_sgn(Z) ((Z)->size < 0 ? -1 : (Z)->size > 0) Therefore the condition must be .. && mpz_sgn(X) != 0) Previously that did not match, because -1 is outside [0:1] but (Z)->size > 0 is unknown. To suppress the bogus C++ warnings I had to suppress the warning when the condition is fully folded in cp_convert_and_check and c_common_truthvalue_conversion is called for the second time. To suppress the bogus C warning on __builtin_isinf_sign I found no other way than changing the expansion of that to isinf(x) ? (signbit(x) ? -1 : 1) + 0 : 0 which is just enough to hide the inner COND_EXPR from c_common_truthvalue_conversion, but gets immediately folded away by fold_binary so it will cause no different code. Furthermore the C++ test case df-warn-signedunsigned1.C also triggered the warning, because here we have: #define MAK (fl < 0 ? 1 : (fl ? -1 : 0)) And thus "if (MAK)" should be written as if (MAK != 0) Finally, what I already wrote in my previous mail the macros in gensupport.c mix binary and ternary logic and should be cleaned up. Bootstrap and reg-test with all languages on x86_64-pc-linux-gnu. Is it OK for trunk? Thanks Bernd.