summaryrefslogtreecommitdiff
path: root/gcc/c-semantics.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-25 01:18:23 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-25 01:18:23 +0000
commitdb8577ff1589efcca201914e2dd4c1eab9b7b99e (patch)
treeb4b203ba10ff34644a7945213fdda6f4dbe0f18e /gcc/c-semantics.c
parentf674a129ca6f046a3a1b8b518a78c2c3f33b9b1f (diff)
downloadgcc-db8577ff1589efcca201914e2dd4c1eab9b7b99e.tar.gz
* c-semantics.c (build_stmt): Remove test of specific tree codes
for TREE_SIDE_EFFECTS handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98693 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-semantics.c')
-rw-r--r--gcc/c-semantics.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index 567a440706b..fe81249117f 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -149,19 +149,12 @@ build_stmt (enum tree_code code, ...)
length = TREE_CODE_LENGTH (code);
SET_EXPR_LOCATION (ret, input_location);
- /* Most statements have implicit side effects all on their own,
- such as control transfer. For those that do, we'll compute
- the real value of TREE_SIDE_EFFECTS from its arguments. */
- switch (code)
- {
- case EXPR_STMT:
- side_effects = false;
- break;
- default:
- side_effects = true;
- break;
- }
+ /* TREE_SIDE_EFFECTS will already be set for statements with
+ implicit side effects. Here we make sure it is set for other
+ expressions by checking whether the parameters have side
+ effects. */
+ side_effects = false;
for (i = 0; i < length; i++)
{
tree t = va_arg (p, tree);
@@ -170,7 +163,7 @@ build_stmt (enum tree_code code, ...)
TREE_OPERAND (ret, i) = t;
}
- TREE_SIDE_EFFECTS (ret) = side_effects;
+ TREE_SIDE_EFFECTS (ret) |= side_effects;
va_end (p);
return ret;