+2011-05-04 Richard Guenther <rguenther@suse.de>
+
+ * trans-array.c (gfc_trans_array_constructor_value): Use
+ size_int for bounds of range types.
+ (gfc_trans_array_constructor_value): Use size_type_node
+ for memcpy argument.
+ * trans-common.c (build_field): Use gfc_charlen_type_node
+ for lengths.
+ * trans-openmp.c (gfc_trans_omp_clauses): Do not pass NULL
+ as type to build_int_cst.
+ * trans-const.c (gfc_build_string_const): Use size_int
+ for bounds of range types.
+ (gfc_build_wide_string_const): Likewise.
+ * trans-stmt.c (gfc_trans_label_assign): Use gfc_charlen_type_node
+ for lengths.
+ (gfc_trans_character_select): Likewise.
+ (gfc_trans_character_select): Do not pass NULL
+ as type to build_int_cst.
+ (gfc_trans_character_select): Use size_int for bounds of range types.
+ * trans-io.c (gfc_build_io_library_fndecls): Likewise.
+ (add_case): Do not pass NULL as type to build_int_cst.
+ (transfer_expr): Likewise.
+ (transfer_array_desc): Likewise.
+ * trans-decl.c (gfc_add_assign_aux_vars): Use gfc_charlen_type_node
+ for lengths.
+ (gfc_trans_assign_aux_var): Likewise.
+ (create_main_function): Use size_int for bounds of range types.
+ * trans-intrinsic.c (gfc_conv_intrinsic_minmax_char): Do not pass
+ NULL as type to build_int_cst.
+ (gfc_conv_intrinsic_spacing): Likewise.
+ (gfc_conv_intrinsic_rrspacing): Likewise.
+ (gfc_conv_intrinsic_len): Use gfc_charlen_type_node for lengths.
+
2011-05-04 Richard Guenther <rguenther@suse.de>
* trans-types.c (gfc_get_array_type_bounds): Remove zero notrunc
p = gfc_constructor_next (p);
}
- bound = build_int_cst (NULL_TREE, n - 1);
+ bound = size_int (n - 1);
/* Create an array type to hold them. */
tmptype = build_range_type (gfc_array_index_type,
gfc_index_zero_node, bound);
init = gfc_build_addr_expr (NULL_TREE, init);
size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (type));
- bound = build_int_cst (NULL_TREE, n * size);
+ bound = build_int_cst (size_type_node, n * size);
tmp = build_call_expr_loc (input_location,
built_in_decls[BUILT_IN_MEMCPY], 3,
tmp, init, bound);
addr = gfc_create_var_np (pvoid_type_node, h->sym->name);
TREE_STATIC (len) = 1;
TREE_STATIC (addr) = 1;
- DECL_INITIAL (len) = build_int_cst (NULL_TREE, -2);
+ DECL_INITIAL (len) = build_int_cst (gfc_charlen_type_node, -2);
gfc_set_decl_location (len, &h->sym->declared_at);
gfc_set_decl_location (addr, &h->sym->declared_at);
GFC_DECL_STRING_LEN (field) = pushdecl_top_level (len);
tree len;
str = build_string (length, s);
- len = build_int_cst (NULL_TREE, length);
+ len = size_int (length);
TREE_TYPE (str) =
build_array_type (gfc_character1_type_node,
build_range_type (gfc_charlen_type_node,
- integer_one_node, len));
+ size_one_node, len));
return str;
}
str = build_string (size, s);
free (s);
- len = build_int_cst (NULL_TREE, length);
+ len = size_int (length);
TREE_TYPE (str) =
build_array_type (gfc_get_char_type (kind),
build_range_type (gfc_charlen_type_node,
- integer_one_node, len));
+ size_one_node, len));
return str;
}
target label's address. Otherwise, value is the length of a format string
and ASSIGN_ADDR is its address. */
if (TREE_STATIC (length))
- DECL_INITIAL (length) = build_int_cst (NULL_TREE, -2);
+ DECL_INITIAL (length) = build_int_cst (gfc_charlen_type_node, -2);
else
gfc_defer_symbol_init (sym);
/* Set the initial value to length. See the comments in
function gfc_add_assign_aux_vars in this file. */
gfc_add_modify (&init, GFC_DECL_STRING_LEN (sym->backend_decl),
- build_int_cst (NULL_TREE, -2));
+ build_int_cst (gfc_charlen_type_node, -2));
gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
}
gfc_option.flag_range_check));
array_type = build_array_type (integer_type_node,
- build_index_type (build_int_cst (NULL_TREE, 7)));
+ build_index_type (size_int (7)));
array = build_constructor (array_type, v);
TREE_CONSTANT (array) = 1;
TREE_STATIC (array) = 1;
args[0] = gfc_build_addr_expr (NULL_TREE, len);
var = gfc_create_var (gfc_get_pchar_type (expr->ts.kind), "pstr");
args[1] = gfc_build_addr_expr (ppvoid_type_node, var);
- args[2] = build_int_cst (NULL_TREE, op);
- args[3] = build_int_cst (NULL_TREE, nargs / 2);
+ args[2] = build_int_cst (integer_type_node, op);
+ args[3] = build_int_cst (integer_type_node, nargs / 2);
if (expr->ts.kind == 1)
function = gfor_fndecl_string_minmax;
switch (arg->expr_type)
{
case EXPR_CONSTANT:
- len = build_int_cst (NULL_TREE, arg->value.character.length);
+ len = build_int_cst (gfc_charlen_type_node, arg->value.character.length);
break;
case EXPR_ARRAY:
stmtblock_t block;
k = gfc_validate_kind (BT_REAL, expr->ts.kind, false);
- prec = build_int_cst (NULL_TREE, gfc_real_kinds[k].digits);
- emin = build_int_cst (NULL_TREE, gfc_real_kinds[k].min_exponent - 1);
+ prec = build_int_cst (integer_type_node, gfc_real_kinds[k].digits);
+ emin = build_int_cst (integer_type_node, gfc_real_kinds[k].min_exponent - 1);
tiny = gfc_conv_mpfr_to_tree (gfc_real_kinds[k].tiny, expr->ts.kind, 0);
frexp = gfc_builtin_decl_for_float_kind (BUILT_IN_FREXP, expr->ts.kind);
gfc_add_expr_to_block (&block, tmp);
tmp = fold_build2_loc (input_location, MINUS_EXPR, integer_type_node,
- build_int_cst (NULL_TREE, prec), e);
+ build_int_cst (integer_type_node, prec), e);
tmp = build_call_expr_loc (input_location, scalbn, 2, x, tmp);
gfc_add_modify (&block, x, tmp);
stmt = gfc_finish_block (&block);
types[IOPARM_type_pchar] = pchar_type_node;
pad_size = 16 * TREE_INT_CST_LOW (TYPE_SIZE_UNIT (pchar_type_node));
pad_size += 32 * TREE_INT_CST_LOW (TYPE_SIZE_UNIT (integer_type_node));
- pad_idx = build_index_type (build_int_cst (NULL_TREE, pad_size - 1));
+ pad_idx = build_index_type (size_int (pad_size - 1));
types[IOPARM_type_pad] = build_array_type (char_type_node, pad_idx);
/* pad actually contains pointers and integers so it needs to have an
if (label == NULL)
return; /* No label, no case */
- value = build_int_cst (NULL_TREE, label_value);
+ value = build_int_cst (integer_type_node, label_value);
/* Make a backend label for this case. */
tmp = gfc_build_label_decl (NULL_TREE);
switch (ts->type)
{
case BT_INTEGER:
- arg2 = build_int_cst (NULL_TREE, kind);
+ arg2 = build_int_cst (integer_type_node, kind);
if (last_dt == READ)
function = iocall[IOCALL_X_INTEGER];
else
break;
case BT_REAL:
- arg2 = build_int_cst (NULL_TREE, kind);
+ arg2 = build_int_cst (integer_type_node, kind);
if (last_dt == READ)
{
if (gfc_real16_is_float128 && ts->kind == 16)
break;
case BT_COMPLEX:
- arg2 = build_int_cst (NULL_TREE, kind);
+ arg2 = build_int_cst (integer_type_node, kind);
if (last_dt == READ)
{
if (gfc_real16_is_float128 && ts->kind == 16)
break;
case BT_LOGICAL:
- arg2 = build_int_cst (NULL_TREE, kind);
+ arg2 = build_int_cst (integer_type_node, kind);
if (last_dt == READ)
function = iocall[IOCALL_X_LOGICAL];
else
arg2 = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (tmp)));
arg2 = fold_convert (gfc_charlen_type_node, arg2);
}
- arg3 = build_int_cst (NULL_TREE, kind);
+ arg3 = build_int_cst (integer_type_node, kind);
if (last_dt == READ)
function = iocall[IOCALL_X_CHARACTER_WIDE];
else
if (ts->type == BT_CHARACTER)
charlen_arg = se->string_length;
else
- charlen_arg = build_int_cst (NULL_TREE, 0);
+ charlen_arg = build_int_cst (gfc_charlen_type_node, 0);
- kind_arg = build_int_cst (NULL_TREE, ts->kind);
+ kind_arg = build_int_cst (integer_type_node, ts->kind);
tmp = gfc_build_addr_expr (NULL_TREE, dt_parm);
if (last_dt == READ)
if (clauses->collapse)
{
c = build_omp_clause (where.lb->location, OMP_CLAUSE_COLLAPSE);
- OMP_CLAUSE_COLLAPSE_EXPR (c) = build_int_cst (NULL, clauses->collapse);
+ OMP_CLAUSE_COLLAPSE_EXPR (c)
+ = build_int_cst (integer_type_node, clauses->collapse);
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
}
gfc_expr *format = code->label1->format;
label_len = format->value.character.length;
- len_tree = build_int_cst (NULL_TREE, label_len);
+ len_tree = build_int_cst (gfc_charlen_type_node, label_len);
label_tree = gfc_build_wide_string_const (format->ts.kind, label_len + 1,
format->value.character.string);
label_tree = gfc_build_addr_expr (pvoid_type_node, label_tree);
tmp = fold_build3_loc (input_location, CASE_LABEL_EXPR,
void_type_node,
(d->low == NULL && d->high == NULL)
- ? NULL : build_int_cst (NULL_TREE, d->n),
+ ? NULL : build_int_cst (integer_type_node,
+ d->n),
NULL, label);
gfc_add_expr_to_block (&body, tmp);
}
}
type = build_array_type (select_struct[k],
- build_index_type (build_int_cst (NULL_TREE, n-1)));
+ build_index_type (size_int (n-1)));
init = build_constructor (type, inits);
TREE_CONSTANT (init) = 1;
gcc_unreachable ();
tmp = build_call_expr_loc (input_location,
- fndecl, 4, init, build_int_cst (NULL_TREE, n),
+ fndecl, 4, init,
+ build_int_cst (gfc_charlen_type_node, n),
expr1se.expr, expr1se.string_length);
case_num = gfc_create_var (integer_type_node, "case_num");
gfc_add_modify (&block, case_num, tmp);