diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-05-07 19:58:29 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-05-07 19:58:29 +0000 |
commit | c99c0026305731b71c697a84d82818e28ad8aaaf (patch) | |
tree | 67d27c098a1229b2020c6d36424e17ce028e09da /gcc/fold-const.c | |
parent | 1400c8e5013a0901298b3adfeb9c5dbfcef2f494 (diff) | |
download | gcc-c99c0026305731b71c697a84d82818e28ad8aaaf.zip gcc-c99c0026305731b71c697a84d82818e28ad8aaaf.tar.gz gcc-c99c0026305731b71c697a84d82818e28ad8aaaf.tar.bz2 |
langhooks.h (lang_hooks_for_types): Change global_bindings_p's return type to bool and adjust comment.
2011-05-07 Eric Botcazou <ebotcazou@adacore.com>
* langhooks.h (lang_hooks_for_types): Change global_bindings_p's return
type to bool and adjust comment.
* fold-const.c (fold_range_test): Adjust call to global_bindings_p.
(fold_mathfn_compare): Remove calls to global_bindings_p.
(fold_inf_compare): Likewise.
* stor-layout.c (variable_size): Adjust call to global_bindings_p.
* c-tree.h (global_bindings_p): Adjust prototype.
* c-decl.c (global_bindings_p): Return bool and simplify.
ada/
* gcc-interface/gigi.h (global_bindings_p): Adjust prototype.
* gcc-interface/utils.c (global_bindings_p): Return bool and simplify.
cp/
* name-lookup.h (global_bindings_p): Adjust prototype.
* name-lookup.c (global_bindings_p): Return bool.
fortran/
* f95-lang.c (global_bindings_p): Return bool and simplify.
go/
* go-lang.c (global_bindings_p): Return bool and simplify.
java/
* java-tree.h (global_bindings_p): Adjust prototype.
* decl.c (global_bindings_p): Return bool.
lto/
* lto-lang.c (global_bindings_p): Return bool.
From-SVN: r173535
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index f7d4e5f..a42921b6 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4849,8 +4849,8 @@ fold_range_test (location_t loc, enum tree_code code, tree type, ? TRUTH_AND_EXPR : TRUTH_OR_EXPR, type, op0, op1); - else if (lang_hooks.decls.global_bindings_p () == 0 - && ! CONTAINS_PLACEHOLDER_P (lhs)) + else if (!lang_hooks.decls.global_bindings_p () + && !CONTAINS_PLACEHOLDER_P (lhs)) { tree common = save_expr (lhs); @@ -6148,10 +6148,6 @@ fold_mathfn_compare (location_t loc, build_real (TREE_TYPE (arg), dconst0)); /* sqrt(x) < y is x >= 0 && x != +Inf, when y is large. */ - if (lang_hooks.decls.global_bindings_p () != 0 - || CONTAINS_PLACEHOLDER_P (arg)) - return NULL_TREE; - arg = save_expr (arg); return fold_build2_loc (loc, TRUTH_ANDIF_EXPR, type, fold_build2_loc (loc, GE_EXPR, type, arg, @@ -6168,18 +6164,14 @@ fold_mathfn_compare (location_t loc, build_real (TREE_TYPE (arg), c2)); /* sqrt(x) < c is the same as x >= 0 && x < c*c. */ - if (lang_hooks.decls.global_bindings_p () == 0 - && ! CONTAINS_PLACEHOLDER_P (arg)) - { - arg = save_expr (arg); - return fold_build2_loc (loc, TRUTH_ANDIF_EXPR, type, + arg = save_expr (arg); + return fold_build2_loc (loc, TRUTH_ANDIF_EXPR, type, fold_build2_loc (loc, GE_EXPR, type, arg, build_real (TREE_TYPE (arg), dconst0)), fold_build2_loc (loc, code, type, arg, build_real (TREE_TYPE (arg), c2))); - } } } @@ -6226,13 +6218,8 @@ fold_inf_compare (location_t loc, enum tree_code code, tree type, return omit_one_operand_loc (loc, type, integer_one_node, arg0); /* x <= +Inf is the same as x == x, i.e. isfinite(x). */ - if (lang_hooks.decls.global_bindings_p () == 0 - && ! CONTAINS_PLACEHOLDER_P (arg0)) - { - arg0 = save_expr (arg0); - return fold_build2_loc (loc, EQ_EXPR, type, arg0, arg0); - } - break; + arg0 = save_expr (arg0); + return fold_build2_loc (loc, EQ_EXPR, type, arg0, arg0); case EQ_EXPR: case GE_EXPR: |