Most likely since the c++ delayed folding merge, but I admit I've bootstrapped trunk on i686-linux 8 days ago, so the window is larger, trunk no longer bootstraps on i686-linux:
../../gcc/gimple-fold.c: In function ‘bool gimple_fold_builtin_printf(gimple_stmt_iterator*, tree, tree, built_in_function)’:
../../gcc/gimple-fold.c:2621:30: error: self-comparison always evaluates to true [-Werror=tautological-compare]
&& (size_t) (int) len == len
This code is not new in there, but supposedly before that we either have not been folding the arguments for -Wtautological-compare, or not so aggressively.
I'd say it is quite common idiom to cast a variable to some other type and compare to itself, with the intent that if the type is the same, it is a no-op check, but if the type is narrower or has different signedness, it filters out some undesirable values.
Note one even can't work around this warning through say:
&& (sizeof (int) >= sizeof (size_t) ? 1 : (size_t) (int) len == len)
Date: Sat Nov 14 18:54:16 2015
New Revision: 230382
* call.c (build_new_op_1): Don't fold arguments to
Still fails on aarch64 as of r230393.
../../gcc/builtins.c:1101:46: error: self-comparison always evaluates to false [-Werror=tautological-compare]
if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
Date: Tue Nov 17 18:16:35 2015
New Revision: 230471
* c-common.c (warn_tautological_cmp): Fold before checking for
Date: Tue Nov 17 21:49:23 2015
New Revision: 230508
* typeck.c (build_static_cast_1): Force a NOP when converting to
the same type.