diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-10-02 08:52:17 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-10-02 08:52:17 +0000 |
commit | 97ca93c3aef6c1b519661e4dddc1e8272f1ccc63 (patch) | |
tree | fbb3f33157826fbf0d0a9efcc6fccd16a1fe4a48 | |
parent | 06900a3427fe455af4e1fb5e59b7d14de453d2f3 (diff) | |
download | gcc-97ca93c3aef6c1b519661e4dddc1e8272f1ccc63.zip gcc-97ca93c3aef6c1b519661e4dddc1e8272f1ccc63.tar.gz gcc-97ca93c3aef6c1b519661e4dddc1e8272f1ccc63.tar.bz2 |
tree.c (build): Don't look at TREE_SIDE_EFFECTS or TREE_RAISES for non-trees.
* tree.c (build): Don't look at TREE_SIDE_EFFECTS or TREE_RAISES
for non-trees.
(build1): Likewise.
From-SVN: r29764
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree.c | 39 |
2 files changed, 35 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07618d7..62642b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Sat Oct 2 02:48:21 1999 Mark P. Mitchell <mark@codesourcery.com> + + * tree.c (build): Don't look at TREE_SIDE_EFFECTS or TREE_RAISES + for non-trees. + (build1): Likewise. + Fri Oct 1 18:01:11 1999 Bernd Schmidt <bernds@cygnus.co.uk> * i386elf.h (TARGET_DEFAULT): Use symbolic constants. @@ -2990,6 +2990,7 @@ build VPROTO((enum tree_code code, tree tt, ...)) register tree t; register int length; register int i; + int fro; VA_START (p, tt); @@ -3002,6 +3003,12 @@ build VPROTO((enum tree_code code, tree tt, ...)) length = tree_code_length[(int) code]; TREE_TYPE (t) = tt; + /* Below, we automatically set TREE_SIDE_EFFECTS and TREE_RAISED for + the result based on those same flags for the arguments. But, if + the arguments aren't really even `tree' expressions, we shouldn't + be trying to do this. */ + fro = first_rtl_op (code); + if (length == 2) { /* This is equivalent to the loop below, but faster. */ @@ -3009,11 +3016,20 @@ build VPROTO((enum tree_code code, tree tt, ...)) register tree arg1 = va_arg (p, tree); TREE_OPERAND (t, 0) = arg0; TREE_OPERAND (t, 1) = arg1; - if ((arg0 && TREE_SIDE_EFFECTS (arg0)) - || (arg1 && TREE_SIDE_EFFECTS (arg1))) - TREE_SIDE_EFFECTS (t) = 1; - TREE_RAISES (t) - = (arg0 && TREE_RAISES (arg0)) || (arg1 && TREE_RAISES (arg1)); + if (arg0 && fro > 0) + { + if (TREE_SIDE_EFFECTS (arg0)) + TREE_SIDE_EFFECTS (t) = 1; + if (TREE_RAISES (arg0)) + TREE_RAISES (t) = 1; + } + if (arg1 && fro > 1) + { + if (TREE_SIDE_EFFECTS (arg1)) + TREE_SIDE_EFFECTS (t) = 1; + if (TREE_RAISES (arg1)) + TREE_RAISES (t) = 1; + } } else if (length == 1) { @@ -3023,9 +3039,12 @@ build VPROTO((enum tree_code code, tree tt, ...)) if (TREE_CODE_CLASS (code) != 's') abort (); TREE_OPERAND (t, 0) = arg0; - if (arg0 && TREE_SIDE_EFFECTS (arg0)) - TREE_SIDE_EFFECTS (t) = 1; - TREE_RAISES (t) = (arg0 && TREE_RAISES (arg0)); + if (fro > 0) + { + if (arg0 && TREE_SIDE_EFFECTS (arg0)) + TREE_SIDE_EFFECTS (t) = 1; + TREE_RAISES (t) = (arg0 && TREE_RAISES (arg0)); + } } else { @@ -3033,7 +3052,7 @@ build VPROTO((enum tree_code code, tree tt, ...)) { register tree operand = va_arg (p, tree); TREE_OPERAND (t, i) = operand; - if (operand) + if (operand && fro > i) { if (TREE_SIDE_EFFECTS (operand)) TREE_SIDE_EFFECTS (t) = 1; @@ -3090,7 +3109,7 @@ build1 (code, type, node) TREE_PERMANENT (t) = 1; TREE_OPERAND (t, 0) = node; - if (node) + if (node && first_rtl_op (code) != 0) { if (TREE_SIDE_EFFECTS (node)) TREE_SIDE_EFFECTS (t) = 1; |