From 9ec227134b783359551d2449e1044bd7eca269e0 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 18 Dec 2002 01:36:51 -0500 Subject: [PATCH] tree.c (make_node): Don't set TREE_TYPE on 's' class nodes. * tree.c (make_node): Don't set TREE_TYPE on 's' class nodes. (build1): Always set TREE_SIDE_EFFECTS on 's' class nodes. From-SVN: r60237 --- gcc/ChangeLog | 3 +++ gcc/tree.c | 35 +++++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d6c9dd79b27..dca13eff81a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2002-12-17 Jason Merrill + * tree.c (make_node): Don't set TREE_TYPE on 's' class nodes. + (build1): Always set TREE_SIDE_EFFECTS on 's' class nodes. + * gcc.c (do_spec_1) ['W']: End any pending argument from the braces. * calls.c (expand_call): Don't try to be clever about expanding diff --git a/gcc/tree.c b/gcc/tree.c index 1bfb66bf6d2..736e38d3997 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -297,7 +297,6 @@ make_node (code) { case 's': TREE_SIDE_EFFECTS (t) = 1; - TREE_TYPE (t) = void_type_node; break; case 'd': @@ -2269,17 +2268,28 @@ build1 (code, type, node) tree type; tree node; { - int length; + int length = sizeof (struct tree_exp); #ifdef GATHER_STATISTICS tree_node_kind kind; #endif tree t; #ifdef GATHER_STATISTICS - if (TREE_CODE_CLASS (code) == 'r') - kind = r_kind; - else - kind = e_kind; + switch (TREE_CODE_CLASS (code)) + { + case 's': /* an expression with side effects */ + kind = s_kind; + break; + case 'r': /* a reference */ + kind = r_kind; + break; + default: + kind = e_kind; + break; + } + + tree_node_counts[(int) kind]++; + tree_node_sizes[(int) kind] += length; #endif #ifdef ENABLE_CHECKING @@ -2289,17 +2299,10 @@ build1 (code, type, node) abort (); #endif /* ENABLE_CHECKING */ - length = sizeof (struct tree_exp); - t = ggc_alloc_tree (length); memset ((PTR) t, 0, sizeof (struct tree_common)); -#ifdef GATHER_STATISTICS - tree_node_counts[(int) kind]++; - tree_node_sizes[(int) kind] += length; -#endif - TREE_SET_CODE (t, code); TREE_TYPE (t) = type; @@ -2311,7 +2314,11 @@ build1 (code, type, node) TREE_READONLY (t) = TREE_READONLY (node); } - switch (code) + if (TREE_CODE_CLASS (code) == 's') + { + TREE_SIDE_EFFECTS (t) = 1; + } + else switch (code) { case INIT_EXPR: case MODIFY_EXPR: -- 2.30.2