===================================================================
@@ -1719,8 +1719,10 @@ dt_node::gen_kids (FILE *f, bool gimple)
{
expr *e = as_a <expr *>(generic_exprs[i]->op);
id_base *op = e->operation;
- /* ??? CONVERT */
- fprintf (f, "case %s:\n", op->id);
+ if (*op == CONVERT_EXPR || *op == NOP_EXPR)
+ fprintf (f, "CASE_CONVERT:\n");
+ else
+ fprintf (f, "case %s:\n", op->id);
fprintf (f, "{\n");
generic_exprs[i]->gen (f, gimple);
fprintf (f, "break;\n"
===================================================================
@@ -28,7 +28,13 @@ along with GCC; see the file COPYING3.
(bitop (convert @0) (convert? @1))
(if (((TREE_CODE (@1) == INTEGER_CST
&& INTEGRAL_TYPE_P (TREE_TYPE (@0))
- && int_fits_type_p (@1, TREE_TYPE (@0)))
+ && int_fits_type_p (@1, TREE_TYPE (@0))
+ /* ??? This transform conflicts with fold-const.c doing
+ Convert (T)(x & c) into (T)x & (T)c, if c is an integer
+ constants (if x has signed type, the sign bit cannot be set
+ in c). This folds extension into the BIT_AND_EXPR.
+ Restrict it to GIMPLE to avoid endless recursions. */
+ && (bitop != BIT_AND_EXPR || GIMPLE))
|| types_compatible_p (TREE_TYPE (@0), TREE_TYPE (@1)))
&& (/* That's a good idea if the conversion widens the operand, thus
after hoisting the conversion the operation will be narrower. */
===================================================================
@@ -3858,7 +3858,7 @@ build_x_array_ref (location_t loc, tree
static bool
enum_cast_to_int (tree op)
{
- if (TREE_CODE (op) == NOP_EXPR
+ if (CONVERT_EXPR_P (op)
&& TREE_TYPE (op) == integer_type_node
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (op, 0))) == ENUMERAL_TYPE
&& TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 0))))