diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-09-07 10:22:44 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-09-07 10:22:44 +0000 |
commit | 5212068fdf32944f8a35909cd5e9eb8d420fbc76 (patch) | |
tree | efd2d72434d72037608c092c5558556582089fc1 /gcc/builtins.c | |
parent | 366de0ce7d916d313aba839a2802cfbc70b991cf (diff) | |
download | gcc-5212068fdf32944f8a35909cd5e9eb8d420fbc76.zip gcc-5212068fdf32944f8a35909cd5e9eb8d420fbc76.tar.gz gcc-5212068fdf32944f8a35909cd5e9eb8d420fbc76.tar.bz2 |
builtins.c (fold_builtin_strchr): Use build_int_cst, not fold_convert.
* builtins.c (fold_builtin_strchr): Use build_int_cst, not
fold_convert.
(fold_builtin_strpbrk): Likewise.
* expr.c (array_ref_low_bound): Likewise.
* tree-scalar-evolution.c (chrec_is_positive, add_to_evolution_1,
interpret_rhs_modify_expr, number_of_iterations_in_loop): Likewise.
* tree-sra.c (generate_element_zero): Likewise.
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
* tree-ssa-loop-ivopts.c (determine_biv_step, idx_find_step,
add_old_iv_candidates, add_iv_candidates): Likewise.
* tree-tailcall.c (tree_optimize_tail_calls_1): Likewise.
From-SVN: r87141
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 97800bf..5096522 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -7210,12 +7210,11 @@ fold_builtin_strchr (tree exp, bool actually_strrchr) r = actually_strrchr ? strrchr (p1, c) : strchr (p1, c); if (r == NULL) - return fold_convert (TREE_TYPE (s1), integer_zero_node); + return build_int_cst (TREE_TYPE (s1), 0); /* Return an offset into the constant string argument. */ return fold (build2 (PLUS_EXPR, TREE_TYPE (s1), - s1, fold_convert (TREE_TYPE (s1), - ssize_int (r - p1)))); + s1, build_int_cst (TREE_TYPE (s1), r - p1))); } if (actually_strrchr) @@ -8645,12 +8644,11 @@ simplify_builtin_strstr (tree arglist) const char *r = strstr (p1, p2); if (r == NULL) - return fold_convert (TREE_TYPE (s1), integer_zero_node); + return build_int_cst (TREE_TYPE (s1), 0); /* Return an offset into the constant string argument. */ return fold (build2 (PLUS_EXPR, TREE_TYPE (s1), - s1, fold_convert (TREE_TYPE (s1), - ssize_int (r - p1)))); + s1, build_int_cst (TREE_TYPE (s1), r - p1))); } if (p2[0] == '\0') @@ -8714,12 +8712,11 @@ simplify_builtin_strchr (tree arglist) r = strchr (p1, c); if (r == NULL) - return fold_convert (TREE_TYPE (s1), integer_zero_node); + return build_int_cst (TREE_TYPE (s1), 0); /* Return an offset into the constant string argument. */ return fold (build2 (PLUS_EXPR, TREE_TYPE (s1), - s1, fold_convert (TREE_TYPE (s1), - ssize_int (r - p1)))); + s1, build_int_cst (TREE_TYPE (s1), r - p1))); } /* FIXME: Should use here strchrM optab so that ports can optimize @@ -8771,12 +8768,11 @@ simplify_builtin_strrchr (tree arglist) r = strrchr (p1, c); if (r == NULL) - return fold_convert (TREE_TYPE (s1), integer_zero_node); + return build_int_cst (TREE_TYPE (s1), 0); /* Return an offset into the constant string argument. */ return fold (build2 (PLUS_EXPR, TREE_TYPE (s1), - s1, fold_convert (TREE_TYPE (s1), - ssize_int (r - p1)))); + s1, build_int_cst (TREE_TYPE (s1), r - p1))); } if (! integer_zerop (s2)) @@ -8829,12 +8825,11 @@ simplify_builtin_strpbrk (tree arglist) const char *r = strpbrk (p1, p2); if (r == NULL) - return fold_convert (TREE_TYPE (s1), integer_zero_node); + return build_int_cst (TREE_TYPE (s1), 0); /* Return an offset into the constant string argument. */ return fold (build2 (PLUS_EXPR, TREE_TYPE (s1), - s1, fold_convert (TREE_TYPE (s1), - ssize_int (r - p1)))); + s1, build_int_cst (TREE_TYPE (s1), r - p1))); } if (p2[0] == '\0') |