diff options
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index b61c11587ec..b6cdf7bebf8 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1121,6 +1121,26 @@ make_node (code) case 'c': TREE_CONSTANT (t) = 1; break; + + case 'e': + switch (code) + { + case INIT_EXPR: + case MODIFY_EXPR: + case RTL_EXPR: + case PREDECREMENT_EXPR: + case PREINCREMENT_EXPR: + case POSTDECREMENT_EXPR: + case POSTINCREMENT_EXPR: + /* All of these have side-effects, no matter what their + operands are. */ + TREE_SIDE_EFFECTS (t) = 1; + break; + + default: + break; + } + break; } return t; @@ -3107,6 +3127,24 @@ build1 (code, type, node) TREE_RAISES (t) = 1; } + switch (code) + { + case INIT_EXPR: + case MODIFY_EXPR: + case RTL_EXPR: + case PREDECREMENT_EXPR: + case PREINCREMENT_EXPR: + case POSTDECREMENT_EXPR: + case POSTINCREMENT_EXPR: + /* All of these have side-effects, no matter what their + operands are. */ + TREE_SIDE_EFFECTS (t) = 1; + break; + + default: + break; + } + return t; } @@ -3300,7 +3338,6 @@ build_type_attribute_variant (ttype, attribute) current_obstack = TYPE_OBSTACK (ttype); ntype = copy_node (ttype); - current_obstack = ambient_obstack; TYPE_POINTER_TO (ntype) = 0; TYPE_REFERENCE_TO (ntype) = 0; @@ -3335,6 +3372,12 @@ build_type_attribute_variant (ttype, attribute) ntype = type_hash_canon (hashcode, ntype); ttype = build_qualified_type (ntype, TYPE_QUALS (ttype)); + + /* We must restore the current obstack after the type_hash_canon call, + because type_hash_canon calls type_hash_add for permanent types, and + then type_hash_add calls oballoc expecting to get something permanent + back. */ + current_obstack = ambient_obstack; } return ttype; |