diff options
Diffstat (limited to 'gcc/fold-const.c')
-rwxr-xr-x | gcc/fold-const.c | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 45ac066..07611bd 100755 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -100,11 +100,6 @@ static tree strip_compound_expr PROTO((tree, tree)); static int multiple_of_p PROTO((tree, tree, tree)); static tree constant_boolean_node PROTO((int, tree)); -/* CYGNUS LOCAL law */ -static tree reduce_expression_tree_depth PROTO ((enum tree_code, - tree, tree, tree)); -/* END CYGNUS LOCAL */ - #ifndef BRANCH_COST #define BRANCH_COST 1 #endif @@ -4303,96 +4298,6 @@ constant_boolean_node (value, type) } } -/* CYGNUS LOCAL law */ -/* Flatten a tree by performing simple reassociations. */ - -static tree -reduce_expression_tree_depth (code, type, arg0, arg1) - enum tree_code code; - tree type; - tree arg0; - tree arg1; -{ - tree ops[8]; - int n_ops; - int i, j, changed; - - zero_memory ((char *)ops, sizeof ops); - - /* Place our operands into the expression array. */ - ops[0] = arg0; - ops[1] = arg1; - n_ops = 2; - - /* Now we want to explode any entry in the array which has a matching - CODE and TYPE. */ - changed = 1; - while (changed) - { - changed = 0; - - for (i = 0; i < n_ops; i++) - { - if (TREE_CODE (ops[i]) == code && TREE_TYPE (ops[i]) == type) - { - if (n_ops == 8) - { - tree t = build (code, type, arg0, arg1); - - TREE_CONSTANT (t) - = (TREE_CONSTANT (arg0) && TREE_CONSTANT (arg1)); - return t; - } - - ops[n_ops] = TREE_OPERAND (ops[i], 1); - ops[i] = TREE_OPERAND (ops[i], 0); - n_ops++; - changed = 1; - } - } - } - - /* If we do not have at least 4 operands, then no reductions - are possible. */ - if (n_ops <= 3) - { - tree t = build (code, type, arg0, arg1); - - TREE_CONSTANT (t) = (TREE_CONSTANT (arg0) && TREE_CONSTANT (arg1)); - return t; - } - - /* Try to simplify each subtree. */ - for (i = 0; i < n_ops; i++) - fold (ops[i]); - - /* Now simplify the operands pair-wise until nothing changes. */ - changed = 1; - while (changed) - { - changed = 0; - - for (i = 0; i < n_ops - 1; i++) - for (j = i + 1; j < n_ops; j++) - if (ops[i] != NULL_TREE && ops[j] != NULL_TREE) - { - tree t; - - t = build (code, type, ops[i], ops[j]); - TREE_CONSTANT (t) - = (TREE_CONSTANT (ops[i]) && TREE_CONSTANT (ops[j])); - ops[i] = t; - ops[j] = 0; - changed = 1; - i++; - } - } - - /* ops[0] should have the fully reduced tree now. */ - return ops[0]; -} -/* END CYGNUS LOCAL */ - /* Perform constant folding and related simplification of EXPR. The related simplifications include x*1 => x, x*0 => 0, etc., and application of the associative law. @@ -5170,29 +5075,6 @@ fold (expr) } } - /* CYGNUS LOCAL law */ - /* If we are optimizing and performing instruction scheduling, then we - want to flatten expression trees. Doing so will expose more ILP at - the cost of using more registers. - - Do not do this on floating point types, unless -ffast-math is - enabled. And even then only do so for multiplies. */ - if (optimize && flag_schedule_insns - /* ??? reduce_expression_tree_depth doesn't handle MINUS correctly. - It doesn't change MINUS to PLUS when necessary. For instance - a - b - b - b needs to be changed to (a - b) - (b + b). */ - && code != MINUS_EXPR - && (! FLOAT_TYPE_P (type) - || (flag_fast_math && code == MULT_EXPR))) - { - t = reduce_expression_tree_depth (code, type, arg0, arg1); - code = TREE_CODE (t); - arg0 = TREE_OPERAND (t, 0); - arg1 = TREE_OPERAND (t, 1); - type = TREE_TYPE (t); - } - /* END CYGNUS LOCAL */ - binary: #if defined (REAL_IS_NOT_DOUBLE) && ! defined (REAL_ARITHMETIC) if (TREE_CODE (arg1) == REAL_CST) |