On Tue, 7 May 2013, Marc Glisse wrote: > On Thu, 2 May 2013, Richard Biener wrote: > > > Can you followup with a patch to do > > s/integer_all_onesp/integer_minus_onep/ where it makes sense? > > This passes bootstrap+testsuite on x86_64-linux-gnu. I kept all_ones for > bitmask type of operations (BIT_*_EXPR, VEC_COND_EXPR) and used minus_one for > the maximal unsigned value. A few cases were not very clear and chosen rather > randomly. There is one place in fold-const where we would actually want > instead an integer_zero_or_all_onesp which checks whether each element of a > vector (or complex) is 0 or -1, which would accept {-1,0,0,-1} for instance, > but I didn't add that.
Hmm, just that I notice now - will integer_minus_onep () return true for -1U? Maybe that's confusing? Richard. > 2013-05-07 Marc Glisse <marc.gli...@inria.fr> > > * convert.c (convert_to_integer): Replace integer_all_onesp with > integer_minus_onep. > * tree-ssa-loop-niter.c (number_of_iterations_lt, > number_of_iterations_exit): Likewise. > * predict.c (tree_predict_by_opcode): Likewise. > * builtins.c (expand_builtin_memory_chk, maybe_emit_chk_warning, > maybe_emit_sprintf_chk_warning, fold_builtin_memory_chk, > fold_builtin_stxcpy_chk, fold_builtin_stxncpy_chk, > fold_builtin_strcat_chk, fold_builtin_strncat_chk, > fold_builtin_sprintf_chk_1, fold_builtin_snprintf_chk_1): Likewise. > * fold-const.c (optimize_bit_field_compare, fold_unary_loc, > fold_binary_loc): Likewise. > * expr.c (do_store_flag): Likewise. > * tree-ssa-phiopt.c (conditional_replacement): Likewise. > >