+2011-04-29 Richard Guenther <rguenther@suse.de>
+
+ * builtins.c (fold_builtin_classify_type): Use integer_type_node
+ for the type of the result.
+ (fold_builtin_isascii): Likewise.
+ (fold_builtin_toascii): Use integer_type_node where appropriate.
+ (fold_builtin_logb): Likewise.
+ (fold_builtin_frexp): Likewise.
+ (fold_builtin_strstr): Likewise.
+ (fold_builtin_strpbrk): Likewise.
+ (fold_builtin_fputs): Likewise.
+ (fold_builtin_sprintf): Likewise.
+ (fold_builtin_snprintf): Likewise.
+ (fold_builtin_printf): Likewise.
+ (do_mpfr_remquo): Use a proper type for the assigned constant.
+ (do_mpfr_lgamma_r): Likewise.
+ * dwarf2out.c (resolve_one_addr): Use size_int.
+ * except.c (init_eh): Likewise.
+ (assign_filter_values): Use integer_type_node for filter values.
+ (sjlj_emit_dispatch_table): Use integer_type_node for dispatch
+ indices.
+ * tree-cfg.c (move_stmt_eh_region_tree_nr): Use integer_type_node
+ for EH region numbers.
+ * tree-vrp.c (simplify_div_or_mod_using_ranges): Use integer_type_node
+ for the shift amount.
+
2011-04-29 Richard Guenther <rguenther@suse.de>
* expr.h (expand_shift): Rename to ...
fold_builtin_classify_type (tree arg)
{
if (arg == 0)
- return build_int_cst (NULL_TREE, no_type_class);
+ return build_int_cst (integer_type_node, no_type_class);
- return build_int_cst (NULL_TREE, type_to_class (TREE_TYPE (arg)));
+ return build_int_cst (integer_type_node, type_to_class (TREE_TYPE (arg)));
}
/* Fold a call to __builtin_strlen with argument ARG. */
{
/* Transform isascii(c) -> ((c & ~0x7f) == 0). */
arg = fold_build2 (BIT_AND_EXPR, integer_type_node, arg,
- build_int_cst (NULL_TREE,
+ build_int_cst (integer_type_node,
~ (unsigned HOST_WIDE_INT) 0x7f));
return fold_build2_loc (loc, EQ_EXPR, integer_type_node,
- arg, integer_zero_node);
+ arg, integer_zero_node);
}
}
/* Transform toascii(c) -> (c & 0x7f). */
return fold_build2_loc (loc, BIT_AND_EXPR, integer_type_node, arg,
- build_int_cst (NULL_TREE, 0x7f));
+ build_int_cst (integer_type_node, 0x7f));
}
/* Fold a call to builtin isdigit with argument ARG. */
exponent and subtract 1. */
if (REAL_MODE_FORMAT (TYPE_MODE (TREE_TYPE (arg)))->b == 2)
return fold_convert_loc (loc, rettype,
- build_int_cst (NULL_TREE,
+ build_int_cst (integer_type_node,
REAL_EXP (value)-1));
break;
}
REAL_VALUE_TYPE frac_rvt = *value;
SET_REAL_EXP (&frac_rvt, 0);
frac = build_real (rettype, frac_rvt);
- exp = build_int_cst (NULL_TREE, REAL_EXP (value));
+ exp = build_int_cst (integer_type_node, REAL_EXP (value));
}
break;
default:
/* New argument list transforming strstr(s1, s2) to
strchr(s1, s2[0]). */
- return build_call_expr_loc (loc, fn, 2, s1, build_int_cst (NULL_TREE, p2[0]));
+ return build_call_expr_loc (loc, fn, 2, s1,
+ build_int_cst (integer_type_node, p2[0]));
}
}
/* New argument list transforming strpbrk(s1, s2) to
strchr(s1, s2[0]). */
- return build_call_expr_loc (loc, fn, 2, s1, build_int_cst (NULL_TREE, p2[0]));
+ return build_call_expr_loc (loc, fn, 2, s1,
+ build_int_cst (integer_type_node, p2[0]));
}
}
{
if (fn_fputc)
return build_call_expr_loc (loc, fn_fputc, 2,
- build_int_cst (NULL_TREE, p[0]), arg1);
+ build_int_cst
+ (integer_type_node, p[0]), arg1);
else
return NULL_TREE;
}
'format' is known to contain no % formats. */
call = build_call_expr_loc (loc, fn, 2, dest, fmt);
if (!ignored)
- retval = build_int_cst (NULL_TREE, strlen (fmt_str));
+ retval = build_int_cst (integer_type_node, strlen (fmt_str));
}
/* If the format is "%s", use strcpy if the result isn't used. */
call = build_call_expr_loc (loc, fn, 2, dest, fmt);
if (!ignored)
- retval = build_int_cst (NULL_TREE, strlen (fmt_str));
+ retval = build_int_cst (integer_type_node, strlen (fmt_str));
}
/* If the format is "%s", use strcpy if the result isn't used. */
/* Given printf("c"), (where c is any one character,)
convert "c"[0] to an int and pass that to the replacement
function. */
- newarg = build_int_cst (NULL_TREE, str[0]);
+ newarg = build_int_cst (integer_type_node, str[0]);
if (fn_putchar)
call = build_call_expr_loc (loc, fn_putchar, 1, newarg);
}
if (TYPE_MAIN_VARIANT (TREE_TYPE (arg_quo)) == integer_type_node)
{
/* Set the value. */
- tree result_quo = fold_build2 (MODIFY_EXPR,
- TREE_TYPE (arg_quo), arg_quo,
- build_int_cst (NULL, integer_quo));
+ tree result_quo
+ = fold_build2 (MODIFY_EXPR, TREE_TYPE (arg_quo), arg_quo,
+ build_int_cst (TREE_TYPE (arg_quo),
+ integer_quo));
TREE_SIDE_EFFECTS (result_quo) = 1;
/* Combine the quo assignment with the rem. */
result = non_lvalue (fold_build2 (COMPOUND_EXPR, type,
/* Assign the signgam value into *arg_sg. */
result_sg = fold_build2 (MODIFY_EXPR,
TREE_TYPE (arg_sg), arg_sg,
- build_int_cst (NULL, sg));
+ build_int_cst (TREE_TYPE (arg_sg), sg));
TREE_SIDE_EFFECTS (result_sg) = 1;
/* Combine the signgam assignment with the lgamma result. */
result = non_lvalue (fold_build2 (COMPOUND_EXPR, type,
integer_type_node);
DECL_FIELD_CONTEXT (f_cs) = sjlj_fc_type_node;
- tmp = build_index_type (build_int_cst (NULL_TREE, 4 - 1));
+ tmp = build_index_type (size_int (4 - 1));
tmp = build_array_type (lang_hooks.types.type_for_mode
(targetm.unwind_word_mode (), 1),
tmp);
#ifdef DONT_USE_BUILTIN_SETJMP
#ifdef JMP_BUF_SIZE
- tmp = build_int_cst (NULL_TREE, JMP_BUF_SIZE - 1);
+ tmp = size_int (JMP_BUF_SIZE - 1);
#else
/* Should be large enough for most systems, if it is not,
JMP_BUF_SIZE should be defined with the proper value. It will
also tend to be larger than necessary for most systems, a more
optimal port will define JMP_BUF_SIZE. */
- tmp = build_int_cst (NULL_TREE, FIRST_PSEUDO_REGISTER + 2 - 1);
+ tmp = size_int (FIRST_PSEUDO_REGISTER + 2 - 1);
#endif
#else
/* builtin_setjmp takes a pointer to 5 words. */
- tmp = build_int_cst (NULL_TREE, 5 * BITS_PER_WORD / POINTER_SIZE - 1);
+ tmp = size_int (5 * BITS_PER_WORD / POINTER_SIZE - 1);
#endif
tmp = build_index_type (tmp);
tmp = build_array_type (ptr_type_node, tmp);
for ( ; tp_node; tp_node = TREE_CHAIN (tp_node))
{
int flt = add_ttypes_entry (ttypes, TREE_VALUE (tp_node));
- tree flt_node = build_int_cst (NULL_TREE, flt);
+ tree flt_node = build_int_cst (integer_type_node, flt);
c->filter_list
= tree_cons (NULL_TREE, flt_node, c->filter_list);
/* Get a filter value for the NULL list also since it
will need an action record anyway. */
int flt = add_ttypes_entry (ttypes, NULL);
- tree flt_node = build_int_cst (NULL_TREE, flt);
+ tree flt_node = build_int_cst (integer_type_node, flt);
c->filter_list
= tree_cons (NULL_TREE, flt_node, NULL);
t_label = create_artificial_label (UNKNOWN_LOCATION);
case_elt = build3 (CASE_LABEL_EXPR, void_type_node,
- build_int_cst (NULL, disp_index),
+ build_int_cst (integer_type_node, disp_index),
NULL, t_label);
gimple_switch_set_label (switch_stmt, disp_index, case_elt);