if (strcmp (IDENTIFIER_POINTER (id), "__ABS") == 0
|| strcmp (IDENTIFIER_POINTER (id), "__ABSU") == 0
|| strcmp (IDENTIFIER_POINTER (id), "__MIN") == 0
+ || strcmp (IDENTIFIER_POINTER (id), "__BIT_INSERT") == 0
|| strcmp (IDENTIFIER_POINTER (id), "__MAX") == 0)
goto build_unary_expr;
break;
return c_parser_gimple_parentized_binary_expression (parser,
op_loc,
MAX_EXPR);
+ else if (strcmp (IDENTIFIER_POINTER (id), "__BIT_INSERT") == 0)
+ {
+ /* __BIT_INSERT '(' postfix-expression, postfix-expression,
+ integer ')' */
+ location_t loc = c_parser_peek_token (parser)->location;
+ c_parser_consume_token (parser);
+ if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>"))
+ {
+ c_expr op0 = c_parser_gimple_postfix_expression (parser);
+ c_parser_skip_until_found (parser, CPP_COMMA,
+ "expected %<,%>");
+ c_expr op1 = c_parser_gimple_postfix_expression (parser);
+ c_parser_skip_until_found (parser, CPP_COMMA,
+ "expected %<,%>");
+ c_expr op2 = c_parser_gimple_postfix_expression (parser);
+ if (TREE_CODE (op2.value) != INTEGER_CST
+ || !int_fits_type_p (op2.value, bitsizetype))
+ c_parser_error (parser, "expected constant offset");
+ c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
+ "expected %<)%>");
+ if (op0.value != error_mark_node
+ && op1.value != error_mark_node
+ && TREE_CODE (op2.value) == INTEGER_CST)
+ ret.value = build3_loc (loc, BIT_INSERT_EXPR,
+ TREE_TYPE (op0.value),
+ op0.value, op1.value,
+ fold_convert (bitsizetype,
+ op2.value));
+ }
+ return ret;
+ }
else
return c_parser_gimple_postfix_expression (parser);
}
break;
case BIT_INSERT_EXPR:
- pp_string (buffer, "BIT_INSERT_EXPR <");
- dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
- pp_string (buffer, ", ");
- dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
- pp_string (buffer, ", ");
- dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
- pp_string (buffer, " (");
- if (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_rhs2 (gs))))
- pp_decimal_int (buffer,
- TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs2 (gs))));
+ if (flags & TDF_GIMPLE)
+ {
+ pp_string (buffer, "__BIT_INSERT (");
+ dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc,
+ flags | TDF_SLIM, false);
+ pp_string (buffer, ", ");
+ dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc,
+ flags | TDF_SLIM, false);
+ pp_string (buffer, ", ");
+ dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc,
+ flags | TDF_SLIM, false);
+ pp_right_paren (buffer);
+ }
else
- dump_generic_node (buffer,
- TYPE_SIZE (TREE_TYPE (gimple_assign_rhs2 (gs))),
- spc, flags, false);
- pp_string (buffer, " bits)>");
+ {
+ pp_string (buffer, "BIT_INSERT_EXPR <");
+ dump_generic_node (buffer, gimple_assign_rhs1 (gs),
+ spc, flags, false);
+ pp_string (buffer, ", ");
+ dump_generic_node (buffer, gimple_assign_rhs2 (gs),
+ spc, flags, false);
+ pp_string (buffer, ", ");
+ dump_generic_node (buffer, gimple_assign_rhs3 (gs),
+ spc, flags, false);
+ pp_string (buffer, " (");
+ if (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_rhs2 (gs))))
+ pp_decimal_int (buffer, TYPE_PRECISION
+ (TREE_TYPE (gimple_assign_rhs2 (gs))));
+ }
break;
default: