On Tue, Jun 02, 2015 at 09:53:14AM +0100, Richard Sandiford wrote: > unsigned int min_prec = (wi::min_precision (op0, SIGNED) > + TREE_INT_CST_LOW (op1)); > bool overflowed = min_prec > TYPE_PRECISION (type0); > if (overflowed && c_inhibit_evaluation_warnings == 0) > warning_at (loc, OPT_Wshift_overflow, > "result of %qE requires %u bits to represent, " > "but %qT only has %u bits", > build2_loc (loc, LSHIFT_EXPR, type0, op0, op1), > min_prec, type0, TYPE_PRECISION (type0)); > > which seems simpler than anything involving wider precision.
Clearly your version is much better, so I'll use it - thanks! I'm testing a new version of the patch, will post it soon. Marek