+2008-12-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/38422
+ * fold-const.c (fold_unary) <CASE_CONVERT>: Don't convert MULT_EXPR
+ operands to mult_type if it isn't narrower than op0's type.
+
2008-12-06 Jan Hubicka <jh@suse.cz>
Jakub Jelinek <jakub@redhat.com>
mult_type = type;
else
mult_type = unsigned_type_for (type);
-
- tem = fold_build2 (MULT_EXPR, mult_type,
- fold_convert (mult_type, TREE_OPERAND (op0, 0)),
- fold_convert (mult_type, TREE_OPERAND (op0, 1)));
- return fold_convert (type, tem);
+
+ if (TYPE_PRECISION (mult_type) < TYPE_PRECISION (TREE_TYPE (op0)))
+ {
+ tem = fold_build2 (MULT_EXPR, mult_type,
+ fold_convert (mult_type,
+ TREE_OPERAND (op0, 0)),
+ fold_convert (mult_type,
+ TREE_OPERAND (op0, 1)));
+ return fold_convert (type, tem);
+ }
}
tem = fold_convert_const (code, type, op0);