------- Comment #4 from rguenth at gcc dot gnu dot org 2006-03-10 14:31 ------- with 4.1 we start with
((intD.0) (short intD.7) ((short unsigned intD.8) a1D.1280 - 10000) + 10000) * 2 which convert builds from converting a - 10000 to short: (short intD.7) ((short unsigned intD.8) a1D.1280 - 10000) this prevents the (now latent) problem in extract_muldiv to show up. I believe case CONVERT_EXPR: case NON_LVALUE_EXPR: case NOP_EXPR: /* If op0 is an expression ... */ if ((COMPARISON_CLASS_P (op0) || UNARY_CLASS_P (op0) || BINARY_CLASS_P (op0) || EXPRESSION_CLASS_P (op0)) /* ... and is unsigned, and its type is smaller than ctype, then we cannot pass through as widening. */ && ((TYPE_UNSIGNED (TREE_TYPE (op0)) && ! (TREE_CODE (TREE_TYPE (op0)) == INTEGER_TYPE && TYPE_IS_SIZETYPE (TREE_TYPE (op0))) && (GET_MODE_SIZE (TYPE_MODE (ctype)) > GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0))))) /* ... or this is a truncation (t is narrower than op0), then we cannot pass through this narrowing. */ || (GET_MODE_SIZE (TYPE_MODE (type)) < GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0)))) the last check needs to read !=, but this extract_muldiv looks like a mess... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26630