aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2003-05-27 14:44:57 -0400
committerRichard Kenner <kenner@gcc.gnu.org>2003-05-27 14:44:57 -0400
commit7a6cdb44fd51d6036d32a732363f19c8e51f0d89 (patch)
tree6be268fb48b8e0a8cb871503b25decd003ae8522 /gcc/fold-const.c
parent86982c71d17f2e9888e649fe5c88b65ff84561d8 (diff)
downloadgcc-7a6cdb44fd51d6036d32a732363f19c8e51f0d89.zip
gcc-7a6cdb44fd51d6036d32a732363f19c8e51f0d89.tar.gz
gcc-7a6cdb44fd51d6036d32a732363f19c8e51f0d89.tar.bz2
tree.h (contains_placeholder_p): Now returns bool.
* tree.h (contains_placeholder_p): Now returns bool. (CONTAINS_PLACEHOLDER_P): New macro. (type_contains_placeholder_p): New function. * tree.c (save_expr): Remove code avoiding folding COMPONENT_REF. (contains_placeholder_p): Now returns bool. Rework to use CONTAINS_PLACEHOLDER_P macro. (type_contains_placeholder_p): New function. * fold-const.c (fold, case COMPONENT_REF): Don't fold if type_contains_placeholder_p. (fold_range_test, fold_mathfn_compare, fold_inf_compare, fold): Use CONTAINS_PLACEHOLDER_P macro. * builtins.c (fold_builtin): Likewise. * calls.c (initialize_argument_information): Likewise. * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * explow.c (expr_size): Likewise. * expr.c (store_constructor, get_inner_reference): Likewise. * function.c (assign_parms): Likewise. * stor-layout.c (variable_size): Likewise. From-SVN: r67189
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6a4e229..381bc9c 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3470,7 +3470,7 @@ fold_range_test (exp)
TREE_OPERAND (exp, 1));
else if ((*lang_hooks.decls.global_bindings_p) () == 0
- && ! contains_placeholder_p (lhs))
+ && ! CONTAINS_PLACEHOLDER_P (lhs))
{
tree common = save_expr (lhs);
@@ -4768,7 +4768,7 @@ fold_mathfn_compare (fcode, code, type, arg0, arg1)
/* sqrt(x) < y is x >= 0 && x != +Inf, when y is large. */
if ((*lang_hooks.decls.global_bindings_p) () != 0
- || contains_placeholder_p (arg))
+ || CONTAINS_PLACEHOLDER_P (arg))
return NULL_TREE;
arg = save_expr (arg);
@@ -4788,7 +4788,7 @@ fold_mathfn_compare (fcode, code, type, arg0, arg1)
/* sqrt(x) < c is the same as x >= 0 && x < c*c. */
if ((*lang_hooks.decls.global_bindings_p) () == 0
- && ! contains_placeholder_p (arg))
+ && ! CONTAINS_PLACEHOLDER_P (arg))
{
arg = save_expr (arg);
return fold (build (TRUTH_ANDIF_EXPR, type,
@@ -4851,7 +4851,7 @@ fold_inf_compare (code, type, arg0, arg1)
/* x <= +Inf is the same as x == x, i.e. isfinite(x). */
if ((*lang_hooks.decls.global_bindings_p) () == 0
- && ! contains_placeholder_p (arg0))
+ && ! CONTAINS_PLACEHOLDER_P (arg0))
{
arg0 = save_expr (arg0);
return fold (build (EQ_EXPR, type, arg0, arg0));
@@ -5119,7 +5119,7 @@ fold (expr)
|| count_cond (arg0, 25) + count_cond (arg1, 25) <= 25)
&& (! TREE_SIDE_EFFECTS (arg0)
|| ((*lang_hooks.decls.global_bindings_p) () == 0
- && ! contains_placeholder_p (arg0))))
+ && ! CONTAINS_PLACEHOLDER_P (arg0))))
return
fold_binary_op_with_conditional_arg (code, type, arg1, arg0,
/*cond_first_p=*/0);
@@ -5133,7 +5133,7 @@ fold (expr)
|| count_cond (arg0, 25) + count_cond (arg1, 25) <= 25)
&& (! TREE_SIDE_EFFECTS (arg1)
|| ((*lang_hooks.decls.global_bindings_p) () == 0
- && ! contains_placeholder_p (arg1))))
+ && ! CONTAINS_PLACEHOLDER_P (arg1))))
return
fold_binary_op_with_conditional_arg (code, type, arg0, arg1,
/*cond_first_p=*/1);
@@ -5313,7 +5313,8 @@ fold (expr)
return t;
case COMPONENT_REF:
- if (TREE_CODE (arg0) == CONSTRUCTOR)
+ if (TREE_CODE (arg0) == CONSTRUCTOR
+ && ! type_contains_placeholder_p (TREE_TYPE (arg0)))
{
tree m = purpose_member (arg1, CONSTRUCTOR_ELTS (arg0));
if (m)
@@ -5883,7 +5884,7 @@ fold (expr)
/* x*2 is x+x */
if (! wins && real_twop (arg1)
&& (*lang_hooks.decls.global_bindings_p) () == 0
- && ! contains_placeholder_p (arg0))
+ && ! CONTAINS_PLACEHOLDER_P (arg0))
{
tree arg = save_expr (arg0);
return fold (build (PLUS_EXPR, type, arg, arg));