summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-07 19:58:29 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-07 19:58:29 +0000
commit1d2bb6555da06fdaae73c53f9aaa38a688e301cd (patch)
tree67d27c098a1229b2020c6d36424e17ce028e09da /gcc/fold-const.c
parentf09431f142f803a83ce9555eece5a4238f2be8a6 (diff)
downloadgcc-1d2bb6555da06fdaae73c53f9aaa38a688e301cd.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173535 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f7d4e5f05c9..a42921b6858 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: