diff options
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 668226d..bd61f29 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -6773,9 +6773,9 @@ static tree 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. */ @@ -9133,10 +9133,10 @@ fold_builtin_isascii (location_t loc, tree 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); } } @@ -9150,7 +9150,7 @@ fold_builtin_toascii (location_t loc, tree arg) /* 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. */ @@ -9341,7 +9341,7 @@ fold_builtin_logb (location_t loc, tree arg, tree rettype) 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; } @@ -9429,7 +9429,7 @@ fold_builtin_frexp (location_t loc, tree arg0, tree arg1, tree rettype) 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: @@ -11214,7 +11214,8 @@ fold_builtin_strstr (location_t loc, tree s1, tree s2, tree type) /* 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])); } } @@ -11400,7 +11401,8 @@ fold_builtin_strpbrk (location_t loc, tree s1, tree s2, tree type) /* 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])); } } @@ -11683,7 +11685,8 @@ fold_builtin_fputs (location_t loc, tree arg0, tree arg1, { 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; } @@ -11855,7 +11858,7 @@ fold_builtin_sprintf (location_t loc, tree dest, tree fmt, '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. */ @@ -11963,7 +11966,7 @@ fold_builtin_snprintf (location_t loc, tree dest, tree destsize, tree fmt, 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. */ @@ -12947,7 +12950,7 @@ fold_builtin_printf (location_t loc, tree fndecl, tree fmt, /* 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); } @@ -13549,9 +13552,10 @@ do_mpfr_remquo (tree arg0, tree arg1, tree arg_quo) 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, @@ -13616,7 +13620,7 @@ do_mpfr_lgamma_r (tree arg, tree arg_sg, tree 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, |