diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 2003-03-19 15:20:57 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2003-03-19 15:20:57 -0500 |
commit | 784fb70e84d78a83a6599824b8b5e44eb85ba633 (patch) | |
tree | 1e2d109a16cdeb7ca8531b1ef3fa890c92d0982a /gcc/tree.c | |
parent | f8a855dcaf51e388cf8fd34889441567f69a5602 (diff) | |
download | gcc-784fb70e84d78a83a6599824b8b5e44eb85ba633.zip gcc-784fb70e84d78a83a6599824b8b5e44eb85ba633.tar.gz gcc-784fb70e84d78a83a6599824b8b5e44eb85ba633.tar.bz2 |
tree.c (substitute_in_expr, case 'e'): Only make recursive call on an operand if it has a PLACEHOLDER_EXPR.
* tree.c (substitute_in_expr, case 'e'): Only make recursive call
on an operand if it has a PLACEHOLDER_EXPR.
From-SVN: r64595
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -1890,8 +1890,13 @@ substitute_in_expr (exp, f, r) else if (code == CONSTRUCTOR) abort (); - op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - op1 = substitute_in_expr (TREE_OPERAND (exp, 1), f, r); + op0 = TREE_OPERAND (exp, 0); + op1 = TREE_OPERAND (exp, 1); + if (contains_placeholder_p (op0)) + op0 = substitute_in_expr (op0, f, r); + if (contains_placeholder_p (op1)) + op1 = substitute_in_expr (op1, f, r); + if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1)) return exp; @@ -1917,9 +1922,17 @@ substitute_in_expr (exp, f, r) else if (code != COND_EXPR) abort (); - op0 = substitute_in_expr (TREE_OPERAND (exp, 0), f, r); - op1 = substitute_in_expr (TREE_OPERAND (exp, 1), f, r); - op2 = substitute_in_expr (TREE_OPERAND (exp, 2), f, r); + op0 = TREE_OPERAND (exp, 0); + op1 = TREE_OPERAND (exp, 1); + op2 = TREE_OPERAND (exp, 2); + + if (contains_placeholder_p (op0)) + op0 = substitute_in_expr (op0, f, r); + if (contains_placeholder_p (op1)) + op1 = substitute_in_expr (op1, f, r); + if (contains_placeholder_p (op2)) + op2 = substitute_in_expr (op2, f, r); + if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1) && op2 == TREE_OPERAND (exp, 2)) return exp; |